diff options
author | Nicolas Fort <nicolasfort1988@gmail.com> | 2023-05-23 14:53:57 -0300 |
---|---|---|
committer | Nicolas Fort <nicolasfort1988@gmail.com> | 2023-08-11 11:40:55 -0300 |
commit | a8244928af84e65dcc9833e14e2de3324b484977 (patch) | |
tree | d559918adc2cb36fd8b94a0939578dd560461ed2 /python/vyos/template.py | |
parent | 1c2209c1dc84993d0f766f3d14df1fb3adf9dda2 (diff) | |
download | vyos-1x-a8244928af84e65dcc9833e14e2de3324b484977.tar.gz vyos-1x-a8244928af84e65dcc9833e14e2de3324b484977.zip |
T5160: firewall refactor: new cli structure. Update jinja templates, python scripts and src firewall
Diffstat (limited to 'python/vyos/template.py')
-rw-r--r-- | python/vyos/template.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/python/vyos/template.py b/python/vyos/template.py index 6469623fd..5a3505b91 100644 --- a/python/vyos/template.py +++ b/python/vyos/template.py @@ -44,7 +44,6 @@ def _get_environment(location=None): loader=loc_loader, trim_blocks=True, undefined=ChainableUndefined, - extensions=['jinja2.ext.loopcontrols'] ) env.filters.update(_FILTERS) env.tests.update(_TESTS) @@ -574,9 +573,9 @@ def nft_action(vyos_action): return vyos_action @register_filter('nft_rule') -def nft_rule(rule_conf, fw_name, rule_id, ip_name='ip'): +def nft_rule(rule_conf, fw_hook, fw_name, rule_id, ip_name='ip'): from vyos.firewall import parse_rule - return parse_rule(rule_conf, fw_name, rule_id, ip_name) + return parse_rule(rule_conf, fw_hook, fw_name, rule_id, ip_name) @register_filter('nft_default_rule') def nft_default_rule(fw_conf, fw_name, ipv6=False): @@ -587,7 +586,8 @@ def nft_default_rule(fw_conf, fw_name, ipv6=False): action_suffix = default_action[:1].upper() output.append(f'log prefix "[{fw_name[:19]}-default-{action_suffix}]"') - output.append(nft_action(default_action)) + #output.append(nft_action(default_action)) + output.append(f'{default_action}') if 'default_jump_target' in fw_conf: target = fw_conf['default_jump_target'] def_suffix = '6' if ipv6 else '' |