From 2dca0f04dc245ae3ec16f36c3c7843882849e25c Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 10 Apr 2022 18:39:16 +0200 Subject: 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. --- src/conf_mode/nat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/conf_mode') 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 -- cgit v1.2.3