summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2024-05-12 12:18:34 +0300
committerGitHub <noreply@github.com>2024-05-12 12:18:34 +0300
commitb976dad08782275f3276be1ab62633fa28860fb1 (patch)
treee3971e1cd13fa692d7e6fe7fb3c4843687b6cdad /src
parent61e1a6deb405c5550d52642fb879260b40340824 (diff)
parent47196ba9b4939ed00297088c757761406e9d562e (diff)
downloadvyos-1x-b976dad08782275f3276be1ab62633fa28860fb1.tar.gz
vyos-1x-b976dad08782275f3276be1ab62633fa28860fb1.zip
Merge pull request #3448 from vyos/mergify/bp/sagitta/pr-3442
T6329: firewall: add a patch for op-mode command <show firewall group> (backport #3442)
Diffstat (limited to 'src')
-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})')