diff options
author | Nicolas Fort <nicolasfort1988@gmail.com> | 2024-05-10 13:28:03 +0000 |
---|---|---|
committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2024-05-12 06:57:41 +0000 |
commit | 5987a9a3475b60a9d544c664b4e1a78a8836e15b (patch) | |
tree | 2b540cf2d43eba751a9a3a225777a15788d8f633 /src | |
parent | 61e1a6deb405c5550d52642fb879260b40340824 (diff) | |
download | vyos-1x-5987a9a3475b60a9d544c664b4e1a78a8836e15b.tar.gz vyos-1x-5987a9a3475b60a9d544c664b4e1a78a8836e15b.zip |
T6329: firewall: add a patch for op-mode command <show firewall group>
(cherry picked from commit 72c95ec1df8ad7be8a715b3338001349684cafa9)
Diffstat (limited to 'src')
-rwxr-xr-x | src/op_mode/firewall.py | 12 |
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})') |