Skip to content

Commit

Permalink
firewall: T970: always use full nft command name (e.g. --file over -f)
Browse files Browse the repository at this point in the history
(cherry picked from commit f1c5188)
  • Loading branch information
c-po authored and mergify[bot] committed Apr 2, 2024
1 parent 6b87d9f commit 9ff1172
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/helpers/vyos-domain-resolver.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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']:
Expand Down Expand Up @@ -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}')

Expand Down

0 comments on commit 9ff1172

Please sign in to comment.