Skip to content

Commit

Permalink
[pbh]: Implement Edit Flows.
Browse files Browse the repository at this point in the history
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
  • Loading branch information
nazariig committed Mar 14, 2022
1 parent 6289987 commit 6e94246
Show file tree
Hide file tree
Showing 8 changed files with 1,181 additions and 366 deletions.
10 changes: 2 additions & 8 deletions clear/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import sys
import click
import utilities_common.cli as clicommon
import json

from utilities_common import util_base
from show.plugins.pbh import read_pbh_counters
from config.plugins.pbh import serialize_pbh_counters
from . import plugins


Expand Down Expand Up @@ -473,14 +473,8 @@ def statistics(db):
pbh_rules = db.cfgdb.get_table("PBH_RULE")
pbh_counters = read_pbh_counters(pbh_rules)

try:
with open('/tmp/.pbh_counters.txt', 'w') as fp:
json.dump(remap_keys(pbh_counters), fp)
except IOError as err:
pass
serialize_pbh_counters(pbh_counters)

def remap_keys(dict):
return [{'key': k, 'value': v} for k, v in dict.items()]

# ("sonic-clear flowcnt-trap")
@cli.command()
Expand Down
Loading

0 comments on commit 6e94246

Please sign in to comment.