Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PBH] Implement Edit Flows #2093

Merged
merged 1 commit into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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