summaryrefslogtreecommitdiff
path: root/src/helpers/vyos-domain-resolver.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-04-01 21:51:42 +0200
committerChristian Breunig <christian@breunig.cc>2024-04-01 21:54:18 +0200
commitf1c51884fb62d3917e92af51d4219e291c7a8e74 (patch)
treef7d1f7253cbc42aa5a8b2dada06e6423176ff2ff /src/helpers/vyos-domain-resolver.py
parent462ba67cf2e193883e33b4ce655b2b0cd1aab80f (diff)
downloadvyos-1x-f1c51884fb62d3917e92af51d4219e291c7a8e74.tar.gz
vyos-1x-f1c51884fb62d3917e92af51d4219e291c7a8e74.zip
firewall: T970: always use full nft command name (e.g. --file over -f)
Diffstat (limited to 'src/helpers/vyos-domain-resolver.py')
-rwxr-xr-xsrc/helpers/vyos-domain-resolver.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/helpers/vyos-domain-resolver.py b/src/helpers/vyos-domain-resolver.py
index eac3d37af..57cfcabd7 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
@@ -95,7 +94,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']:
@@ -155,7 +154,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}')