summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-03-21 19:17:21 +0100
committerGitHub <noreply@github.com>2023-03-21 19:17:21 +0100
commit4e627d57290c85f15779ca0246aebbaa2d5c3d5f (patch)
tree4ba7dd46cc9d27fb6d19f9580c41dc0c7517d644
parent1964fd7c75742abb668fba6a4e06cbf5803374da (diff)
parent88d6dcca6b940ab67fc1607b75276a64436df4d3 (diff)
downloadvyos-1x-4e627d57290c85f15779ca0246aebbaa2d5c3d5f.tar.gz
vyos-1x-4e627d57290c85f15779ca0246aebbaa2d5c3d5f.zip
Merge pull request #1902 from nicolas-fort/T5050-log
T5050: fix smoketest policy_route, which was failing after previos co…
-rw-r--r--python/vyos/firewall.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/python/vyos/firewall.py b/python/vyos/firewall.py
index 137fd2c56..919032a41 100644
--- a/python/vyos/firewall.py
+++ b/python/vyos/firewall.py
@@ -223,21 +223,23 @@ def parse_rule(rule_conf, fw_name, rule_id, ip_name):
action = rule_conf['action'] if 'action' in rule_conf else 'accept'
output.append(f'log prefix "[{fw_name[:19]}-{rule_id}-{action[:1].upper()}]"')
- if 'level' in rule_conf['log_options']:
- log_level = rule_conf['log_options']['level']
- output.append(f'log level {log_level}')
+ if 'log_options' in rule_conf:
- if 'group' in rule_conf['log_options']:
- log_group = rule_conf['log_options']['group']
- output.append(f'log group {log_group}')
+ if 'level' in rule_conf['log_options']:
+ log_level = rule_conf['log_options']['level']
+ output.append(f'log level {log_level}')
- if 'queue_threshold' in rule_conf['log_options']:
- queue_threshold = rule_conf['log_options']['queue_threshold']
- output.append(f'queue-threshold {queue_threshold}')
+ if 'group' in rule_conf['log_options']:
+ log_group = rule_conf['log_options']['group']
+ output.append(f'log group {log_group}')
- if 'snapshot_length' in rule_conf['log_options']:
- log_snaplen = rule_conf['log_options']['snapshot_length']
- output.append(f'snaplen {log_snaplen}')
+ if 'queue_threshold' in rule_conf['log_options']:
+ queue_threshold = rule_conf['log_options']['queue_threshold']
+ output.append(f'queue-threshold {queue_threshold}')
+
+ if 'snapshot_length' in rule_conf['log_options']:
+ log_snaplen = rule_conf['log_options']['snapshot_length']
+ output.append(f'snaplen {log_snaplen}')
if 'hop_limit' in rule_conf:
operators = {'eq': '==', 'gt': '>', 'lt': '<'}