From b0a9782a4a611c375fb3313887a8144fdacbd18c Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Sun, 10 Sep 2023 11:39:51 +0000 Subject: T5564: Fix show firewall group and show firewall summary The `rule` key could be not exists in the entry of the dictionary for examppe `{'default_action': 'drop'}` Fix it (cherry picked from commit 9daac1632df96b6d2089244e3c7a7b42ae682eb9) --- src/op_mode/firewall.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/op_mode/firewall.py b/src/op_mode/firewall.py index 581710b31..c5d5848c2 100755 --- a/src/op_mode/firewall.py +++ b/src/op_mode/firewall.py @@ -267,6 +267,8 @@ def show_firewall_group(name=None): for priority, priority_conf in firewall[item][name_type].items(): if priority not in firewall[item][name_type]: continue + if 'rule' not in priority_conf: + continue for rule_id, rule_conf in priority_conf['rule'].items(): source_group = dict_search_args(rule_conf, 'source', 'group', group_type) dest_group = dict_search_args(rule_conf, 'destination', 'group', group_type) -- cgit v1.2.3