summaryrefslogtreecommitdiff
path: root/src/op_mode
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-05-12 08:57:19 +0200
committerGitHub <noreply@github.com>2024-05-12 08:57:19 +0200
commit4fc9d38edecd5775a8446d8099c89043eedd9b5d (patch)
tree071066fb4497f74c6fdb33381f044d0c56077b85 /src/op_mode
parentef8ec78ac2ce2df0c7e7b15f94ad18d966ce6d39 (diff)
parentb705adc40b761e338026b938d80398fdb281a197 (diff)
downloadvyos-1x-4fc9d38edecd5775a8446d8099c89043eedd9b5d.tar.gz
vyos-1x-4fc9d38edecd5775a8446d8099c89043eedd9b5d.zip
Merge pull request #3442 from nicolas-fort/T6329
T6329: firewall: add a patch for op-mode command <show firewall group>
Diffstat (limited to 'src/op_mode')
-rwxr-xr-xsrc/op_mode/firewall.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/op_mode/firewall.py b/src/op_mode/firewall.py
index 442c186cc..15fbb65a2 100755
--- a/src/op_mode/firewall.py
+++ b/src/op_mode/firewall.py
@@ -531,9 +531,15 @@ def show_firewall_group(name=None):
continue
for idx, member in enumerate(members):
- val = member.get('val', 'N/D')
- timeout = str(member.get('timeout', 'N/D'))
- expires = str(member.get('expires', 'N/D'))
+ if isinstance(member, str):
+ # Only member, and no timeout:
+ val = member
+ timeout = "N/D"
+ expires = "N/D"
+ else:
+ val = member.get('val', 'N/D')
+ timeout = str(member.get('timeout', 'N/D'))
+ expires = str(member.get('expires', 'N/D'))
if args.detail:
row.append(f'{val} (timeout: {timeout}, expires: {expires})')