From ff512e367531fd379cb08522d16fb840b7c1a82b Mon Sep 17 00:00:00 2001 From: Stepan Blyschak Date: Fri, 5 Jul 2019 14:43:00 +0300 Subject: [PATCH] [acl-loader] change helper functions to pop_* Signed-off-by: Stepan Blyschak --- acl_loader/main.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/acl_loader/main.py b/acl_loader/main.py index efdb97d934..15d9907413 100644 --- a/acl_loader/main.py +++ b/acl_loader/main.py @@ -328,6 +328,7 @@ def validate_actions(self, table_name, action_props): if action_value not in capability[key]: del action_props[action_key] + continue return action_count == len(action_props) @@ -667,11 +668,11 @@ def show_rule(self, table_name, rule_id): """ header = ("Table", "Rule", "Priority", "Action", "Match") - def show_priority(val): + def pop_priority(val): priority = val.pop("PRIORITY") return priority - def show_action(val): + def pop_action(val): action = "" for key in dict(val): @@ -689,7 +690,7 @@ def show_action(val): return action - def show_matches(val): + def pop_matches(val): matches = list(sorted(["%s: %s" % (k, val[k]) for k in val])) if len(matches) == 0: matches.append("N/A") @@ -704,9 +705,9 @@ def show_matches(val): if rule_id and rule_id != rid: continue - priority = show_priority(val) - action = show_action(val) - matches = show_matches(val) + priority = pop_priority(val) + action = pop_action(val) + matches = pop_matches(val) rule_data = [[tname, rid, priority, action, matches[0]]] if len(matches) > 1: