summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-04-01 21:46:13 +0200
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-04-02 16:33:03 +0000
commit33cb8f4f9665c8b634d998e39354d00d6bf31855 (patch)
treed8c2a75d980260aa44edb324aa49fc2c451555db /src/conf_mode
parent0cb21915164551b3d2eaab79ed6339184957c326 (diff)
downloadvyos-1x-33cb8f4f9665c8b634d998e39354d00d6bf31855.tar.gz
vyos-1x-33cb8f4f9665c8b634d998e39354d00d6bf31855.zip
firewall: T2199: always use full nft command name (e.g. --file over -f)
(cherry picked from commit 6e0fdbcbba39691461f791c7a68a2c6c5091d2c1)
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/firewall.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/conf_mode/firewall.py b/src/conf_mode/firewall.py
index 810437dda..3cf618363 100755
--- a/src/conf_mode/firewall.py
+++ b/src/conf_mode/firewall.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2021-2023 VyOS maintainers and contributors
+# Copyright (C) 2021-2024 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -18,7 +18,6 @@ import os
import re
from glob import glob
-from json import loads
from sys import exit
from vyos.base import Warning
@@ -31,11 +30,9 @@ from vyos.ethtool import Ethtool
from vyos.firewall import fqdn_config_parse
from vyos.firewall import geoip_update
from vyos.template import render
-from vyos.utils.process import call
-from vyos.utils.process import cmd
from vyos.utils.dict import dict_search_args
from vyos.utils.dict import dict_search_recursive
-from vyos.utils.process import process_named_running
+from vyos.utils.process import call
from vyos.utils.process import rc_cmd
from vyos import ConfigError
from vyos import airbag
@@ -491,7 +488,7 @@ def apply_sysfs(firewall):
f.write(value)
def apply(firewall):
- install_result, output = rc_cmd(f'nft -f {nftables_conf}')
+ install_result, output = rc_cmd(f'nft --file {nftables_conf}')
if install_result == 1:
raise ConfigError(f'Failed to apply firewall: {output}')