summaryrefslogtreecommitdiff
path: root/src/op_mode/openconnect.py
diff options
context:
space:
mode:
authormergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-07-19 13:45:45 +0300
committerGitHub <noreply@github.com>2024-07-19 13:45:45 +0300
commit5be256235052592dab254f55f5f329feb5e955b0 (patch)
treedc7a8cc7f1de165f57e2b40c44f8ea588960244e /src/op_mode/openconnect.py
parent623d773fa253b9dc21c4f321ed38535cbc03c5f0 (diff)
downloadvyos-1x-5be256235052592dab254f55f5f329feb5e955b0.tar.gz
vyos-1x-5be256235052592dab254f55f5f329feb5e955b0.zip
T6578: Fix unhandled exception in "show openconnect-server sessions" (#3830)
(cherry picked from commit e858d96a3fbc1ae4719a50ee67df02b2f256b40f) Co-authored-by: khramshinr <khramshinr@gmail.com>
Diffstat (limited to 'src/op_mode/openconnect.py')
-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)