summaryrefslogtreecommitdiff
path: root/python/vyos/firewall.py
diff options
context:
space:
mode:
authorNicolas Fort <nicolasfort1988@gmail.com>2022-05-11 16:41:21 +0000
committerNicolas Fort <nicolasfort1988@gmail.com>2022-05-11 16:41:21 +0000
commit1ca645d1a499441abb74c549e7e1fbd03087097d (patch)
tree9057243e8ff6c3450b7b91496672732c117d3b57 /python/vyos/firewall.py
parent432fd1b5e7b5a1e5b8503bf0dcd106369e323dc7 (diff)
downloadvyos-1x-1ca645d1a499441abb74c549e7e1fbd03087097d.tar.gz
vyos-1x-1ca645d1a499441abb74c549e7e1fbd03087097d.zip
Firewall: T3907: add log-level options in firewall
Diffstat (limited to 'python/vyos/firewall.py')
-rw-r--r--python/vyos/firewall.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/vyos/firewall.py b/python/vyos/firewall.py
index 04fd44173..0c6811d72 100644
--- a/python/vyos/firewall.py
+++ b/python/vyos/firewall.py
@@ -146,9 +146,10 @@ def parse_rule(rule_conf, fw_name, rule_id, ip_name):
output.append(f'{proto} {prefix}port {operator} $P_{group_name}')
- if 'log' in rule_conf and rule_conf['log'] == 'enable':
+ if 'log' in rule_conf:
action = rule_conf['action'] if 'action' in rule_conf else 'accept'
- output.append(f'log prefix "[{fw_name[:19]}-{rule_id}-{action[:1].upper()}] "')
+ log_level = rule_conf['log']
+ output.append(f'log prefix "[{fw_name[:19]}-{rule_id}-{action[:1].upper()}]" level {log_level}')
if 'hop_limit' in rule_conf:
operators = {'eq': '==', 'gt': '>', 'lt': '<'}