summaryrefslogtreecommitdiff
path: root/python/vyos/template.py
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2022-06-10 17:47:51 +0300
committerGitHub <noreply@github.com>2022-06-10 17:47:51 +0300
commitfcad9572e880ab5dd71636e0aa4842dc8997bc44 (patch)
tree8ab5210f5c4d716cd586ee93d04aeedba723d0ca /python/vyos/template.py
parent865f38d22a072ee129af2044399ec74b262e897a (diff)
parent2f3fdb9e96a14abf89a32391b44e24b02c3a96f2 (diff)
downloadvyos-1x-fcad9572e880ab5dd71636e0aa4842dc8997bc44.tar.gz
vyos-1x-fcad9572e880ab5dd71636e0aa4842dc8997bc44.zip
Merge pull request #1322 from nicolas-fort/T3907-fwall-log
Firewall: T3907: add log-level options in firewall
Diffstat (limited to 'python/vyos/template.py')
-rw-r--r--python/vyos/template.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/python/vyos/template.py b/python/vyos/template.py
index 132f5ddde..ee82f8f8f 100644
--- a/python/vyos/template.py
+++ b/python/vyos/template.py
@@ -554,7 +554,7 @@ def nft_default_rule(fw_conf, fw_name):
if 'enable_default_log' in fw_conf:
action_suffix = default_action[:1].upper()
- output.append(f'log prefix "[{fw_name[:19]}-default-{action_suffix}] "')
+ output.append(f'log prefix "[{fw_name[:19]}-default-{action_suffix}]"')
output.append(nft_action(default_action))
output.append(f'comment "{fw_name} default-action {default_action}"')
@@ -564,8 +564,9 @@ def nft_default_rule(fw_conf, fw_name):
def nft_state_policy(conf, state, ipv6=False):
out = [f'ct state {state}']
- if 'log' in conf and 'enable' in conf['log']:
- out.append('log')
+ if 'log' in conf:
+ log_level = conf['log']
+ out.append(f'log level {log_level}')
out.append('counter')