diff options
author | Christian Breunig <christian@breunig.cc> | 2024-04-01 21:48:41 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-04-01 21:53:44 +0200 |
commit | e257155aea09b906d8784cb6143d3ab27578c4a8 (patch) | |
tree | 6d4f5f355642c16196d351c8f4fe6ad2d1c5aaeb /src/conf_mode/nat.py | |
parent | 09ac2851f89f2b7d94a21c3506e46f380e961fba (diff) | |
download | vyos-1x-e257155aea09b906d8784cb6143d3ab27578c4a8.tar.gz vyos-1x-e257155aea09b906d8784cb6143d3ab27578c4a8.zip |
nat: T2199: always use full nft command name (e.g. --file over -f)
Diffstat (limited to 'src/conf_mode/nat.py')
-rwxr-xr-x | src/conf_mode/nat.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/conf_mode/nat.py b/src/conf_mode/nat.py index b3f38c04a..76c07a9ec 100755 --- a/src/conf_mode/nat.py +++ b/src/conf_mode/nat.py @@ -223,19 +223,19 @@ def generate(nat): render(nftables_static_nat_conf, 'firewall/nftables-static-nat.j2', nat) # dry-run newly generated configuration - tmp = run(f'nft -c -f {nftables_nat_config}') + tmp = run(f'nft --check --file {nftables_nat_config}') if tmp > 0: raise ConfigError('Configuration file errors encountered!') - tmp = run(f'nft -c -f {nftables_static_nat_conf}') + tmp = run(f'nft --check --file {nftables_static_nat_conf}') if tmp > 0: raise ConfigError('Configuration file errors encountered!') return None def apply(nat): - cmd(f'nft -f {nftables_nat_config}') - cmd(f'nft -f {nftables_static_nat_conf}') + cmd(f'nft --file {nftables_nat_config}') + cmd(f'nft --file {nftables_static_nat_conf}') if not nat or 'deleted' in nat: os.unlink(nftables_nat_config) |