summaryrefslogtreecommitdiff
path: root/src/helpers/vyos-domain-resolver.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-04-02 18:50:42 +0200
committerGitHub <noreply@github.com>2024-04-02 18:50:42 +0200
commit92be9ee46943f38648daeb75da729a460daea9c9 (patch)
treeb6ca67716ab8e6716f56d42557adc5b55a92cd80 /src/helpers/vyos-domain-resolver.py
parent0cb21915164551b3d2eaab79ed6339184957c326 (diff)
parent33b031cc9005e51129719ff42d70bf50fb7f14e1 (diff)
downloadvyos-1x-92be9ee46943f38648daeb75da729a460daea9c9.tar.gz
vyos-1x-92be9ee46943f38648daeb75da729a460daea9c9.zip
Merge pull request #3234 from vyos/mergify/bp/sagitta/pr-3230
firewall: nat: policy: vrf: nft call syntax and import cleanup (backport #3230)
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 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}')