summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-07-19 15:12:00 +0200
committerGitHub <noreply@github.com>2024-07-19 15:12:00 +0200
commit5ae173c05defa1e230552271018133816ca00467 (patch)
tree0923eaf03126b87675ccadc000949099db1d61f4
parent0ec9cdd65473b35197c60dd531610a7007712089 (diff)
parent3cb7d4f8157afd28c03cb58589d3ac5f68c9b8ba (diff)
downloadvyos-1x-5ae173c05defa1e230552271018133816ca00467.tar.gz
vyos-1x-5ae173c05defa1e230552271018133816ca00467.zip
Merge pull request #3831 from vyos/mergify/bp/sagitta/pr-3828
T6578: Fix unhandled exception in "show openconnect-server sessions" (backport #3828)
-rwxr-xr-xsrc/op_mode/openconnect.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/op_mode/openconnect.py b/src/op_mode/openconnect.py
index cfa0678a7..62c683ebb 100755
--- a/src/op_mode/openconnect.py
+++ b/src/op_mode/openconnect.py
@@ -42,8 +42,10 @@ def _get_formatted_sessions(data):
ses_list = []
for ses in data:
ses_list.append([
- ses["Device"], ses["Username"], ses["IPv4"], ses["Remote IP"],
- ses["_RX"], ses["_TX"], ses["State"], ses["_Connected at"]
+ ses.get("Device", '(none)'), ses.get("Username", '(none)'),
+ ses.get("IPv4", '(none)'), ses.get("Remote IP", '(none)'),
+ ses.get("_RX", '(none)'), ses.get("_TX", '(none)'),
+ ses.get("State", '(none)'), ses.get("_Connected at", '(none)')
])
if len(ses_list) > 0:
output = tabulate(ses_list, headers)