diff options
author | Christian Breunig <christian@breunig.cc> | 2024-04-02 18:32:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-02 18:32:23 +0200 |
commit | 7ee2f016878ed29120baa66f8e1d372f97402c96 (patch) | |
tree | e480e1f12e0ca1dbe4c29fdccf213063ceda32a3 /src/helpers/vyos-domain-resolver.py | |
parent | 2a031e68cbe6b0e9beb6e57b2f93b4ec4d95c84f (diff) | |
parent | 0529371bc587e2fcdd8794061e9bb9d60c792c43 (diff) | |
download | vyos-1x-7ee2f016878ed29120baa66f8e1d372f97402c96.tar.gz vyos-1x-7ee2f016878ed29120baa66f8e1d372f97402c96.zip |
Merge pull request #3230 from c-po/syntax-cleanup
firewall: nat: policy: vrf: nft call syntax and import cleanup
Diffstat (limited to 'src/helpers/vyos-domain-resolver.py')
-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 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}') |