diff options
author | Christian Breunig <christian@breunig.cc> | 2024-04-01 21:51:42 +0200 |
---|---|---|
committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2024-04-02 16:33:04 +0000 |
commit | 9ff1172aedc2d98c1050851ebea248f056cc2a1d (patch) | |
tree | 842e904dd23eaa9a7f39a3c47702072a0acfb395 /src/helpers | |
parent | 6b87d9f3100e2a0503a5d415cc01aacfb1d41f6f (diff) | |
download | vyos-1x-9ff1172aedc2d98c1050851ebea248f056cc2a1d.tar.gz vyos-1x-9ff1172aedc2d98c1050851ebea248f056cc2a1d.zip |
firewall: T970: always use full nft command name (e.g. --file over -f)
(cherry picked from commit f1c51884fb62d3917e92af51d4219e291c7a8e74)
Diffstat (limited to 'src/helpers')
-rwxr-xr-x | src/helpers/vyos-domain-resolver.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/helpers/vyos-domain-resolver.py b/src/helpers/vyos-domain-resolver.py index 7e2fe2462..05aae48ff 100755 --- a/src/helpers/vyos-domain-resolver.py +++ b/src/helpers/vyos-domain-resolver.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2022-2023 VyOS maintainers and contributors +# Copyright (C) 2022-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 @@ -15,7 +15,6 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import json -import os import time from vyos.configdict import dict_merge @@ -93,7 +92,7 @@ def nft_output(table, set_name, ip_list): def nft_valid_sets(): try: valid_sets = [] - sets_json = cmd('nft -j list sets') + sets_json = cmd('nft --json list sets') sets_obj = json.loads(sets_json) for obj in sets_obj['nftables']: @@ -153,7 +152,7 @@ def update(firewall): count += 1 nft_conf_str = "\n".join(conf_lines) + "\n" - code = run(f'nft -f -', input=nft_conf_str) + code = run(f'nft --file -', input=nft_conf_str) print(f'Updated {count} sets - result: {code}') |