summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-09-26 22:06:34 +0200
committerGitHub <noreply@github.com>2026-09-26 22:06:34 +0200
commitecd3a01a9563f77d9d9e5a9ef5d9b1b9aacc2fda (patch)
tree8393973ac46b3fead60b89df05fd3c5411e6e7c9 /src
parent13612846c457ce8ae490a4033aff0cf3fe6f2dcb (diff)
parentb931a4cce2f20e447269fa82f5aac155f694b1b7 (diff)
downloadvyos-1x-ecd3a01a9563f77d9d9e5a9ef5d9b1b9aacc2fda.tar.gz
vyos-1x-ecd3a01a9563f77d9d9e5a9ef5d9b1b9aacc2fda.zip
Merge pull request #5398 from ruben-herold/T9205-firewall-ruff-cleanup
firewall: T9205: fix ruff findings in conf_mode/op_mode firewall.py
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/firewall.py2
-rwxr-xr-xsrc/op_mode/firewall.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/conf_mode/firewall.py b/src/conf_mode/firewall.py
index 3a01d2225..304276b6c 100755
--- a/src/conf_mode/firewall.py
+++ b/src/conf_mode/firewall.py
@@ -791,7 +791,7 @@ def apply(firewall):
## DOMAIN RESOLVER
domain_action = 'restart'
if dict_search_args(firewall, 'group', 'remote_group') or dict_search_args(firewall, 'group', 'domain_group') or firewall['ip_fqdn'].items() or firewall['ip6_fqdn'].items():
- text = f'# Automatically generated by firewall.py\nThis file indicates that vyos-domain-resolver service is used by the firewall.\n'
+ text = '# Automatically generated by firewall.py\nThis file indicates that vyos-domain-resolver service is used by the firewall.\n'
write_file(domain_resolver_usage, text)
else:
if os.path.exists(domain_resolver_usage):
diff --git a/src/op_mode/firewall.py b/src/op_mode/firewall.py
index 962eff639..0d58ba3c7 100755
--- a/src/op_mode/firewall.py
+++ b/src/op_mode/firewall.py
@@ -74,7 +74,7 @@ def get_nftables_details(family, hook, priority):
try:
results = cmdl(command)
- except:
+ except (OSError, UnicodeDecodeError):
return {}
out = {}
@@ -112,7 +112,7 @@ def get_nftables_state_details(family):
command = ['nft', 'list', 'chain', suffix, 'vyos_filter', f'VYOS_STATE_{name_suffix}']
try:
results = cmdl(command)
- except:
+ except (OSError, UnicodeDecodeError):
return {}
out = {}
@@ -135,7 +135,7 @@ def get_nftables_group_members(family, table, name):
try:
results_str = cmdl(['nft', '-j', 'list', 'set', prefix, table, name])
results = json.loads(results_str)
- except:
+ except (OSError, UnicodeDecodeError, json.JSONDecodeError):
return out
if 'nftables' not in results:
@@ -163,7 +163,7 @@ def get_nftables_remote_group_members(family, table, name):
try:
results_str = cmdl(['nft', '-j', 'list', 'set', prefix, table, name])
results = json.loads(results_str)
- except:
+ except (OSError, UnicodeDecodeError, json.JSONDecodeError):
return out
if 'nftables' not in results: