summaryrefslogtreecommitdiff
path: root/src/op_mode
diff options
context:
space:
mode:
authorNicolas Fort <nicolasfort1988@gmail.com>2024-05-10 13:28:03 +0000
committerNicolas Fort <nicolasfort1988@gmail.com>2024-05-10 13:28:03 +0000
commit72c95ec1df8ad7be8a715b3338001349684cafa9 (patch)
treef60bf8ec95dabe7bb4e74d6da37639ae24a9ca2c /src/op_mode
parent8fa1cb497f8f4e16d95c1485897663220d86c18e (diff)
downloadvyos-1x-72c95ec1df8ad7be8a715b3338001349684cafa9.tar.gz
vyos-1x-72c95ec1df8ad7be8a715b3338001349684cafa9.zip
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..3f8ba6fa1 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 type(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})')