diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-04-10 18:39:16 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-04-10 18:39:16 +0200 |
commit | 2dca0f04dc245ae3ec16f36c3c7843882849e25c (patch) | |
tree | ed9d8ac98571fe8a505001fae157a684699c116c /src/conf_mode | |
parent | cb8306cb2efd88e633111bb1455f9c22d9c0f8a9 (diff) | |
download | vyos-1x-2dca0f04dc245ae3ec16f36c3c7843882849e25c.tar.gz vyos-1x-2dca0f04dc245ae3ec16f36c3c7843882849e25c.zip |
nat: T2199: bugfix dry-run newly generated config before install
Commit bb76e8d7f1635 ("nat: T2199: dry-run newly generated config before
install") added support to verify the generated nftables ruleset. Unfortunately
if the verify failed - a Python exception was triggered:
NameError: name 'nftables_ct_file' is not defined
This was due to bad copy/pasting.
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/nat.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/conf_mode/nat.py b/src/conf_mode/nat.py index 9f319fc8a..14ca7bc94 100755 --- a/src/conf_mode/nat.py +++ b/src/conf_mode/nat.py @@ -185,8 +185,8 @@ def generate(nat): # dry-run newly generated configuration tmp = run(f'nft -c -f {nftables_nat_config}') if tmp > 0: - if os.path.exists(nftables_ct_file): - os.unlink(nftables_ct_file) + if os.path.exists(nftables_nat_config): + os.unlink(nftables_nat_config) raise ConfigError('Configuration file errors encountered!') return None |