summaryrefslogtreecommitdiff
path: root/src/op_mode
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2022-10-27 14:13:33 -0500
committerGitHub <noreply@github.com>2022-10-27 14:13:33 -0500
commitea8d4ae325059681460f6c74751cfe8ebb2931bc (patch)
treece033329dcc6e736d7b236ead735078b5d7bf33c /src/op_mode
parentc65931f338f49866762b155784ee68afc5c6f2f3 (diff)
parent413e24400c54f398ef73347df2e877aef422400e (diff)
downloadvyos-1x-ea8d4ae325059681460f6c74751cfe8ebb2931bc.tar.gz
vyos-1x-ea8d4ae325059681460f6c74751cfe8ebb2931bc.zip
Merge pull request #1620 from jestabro/ipsec_show_sa
ipsec: T4778: raise UnconfiguredSubsystem if IPsec not initialized
Diffstat (limited to 'src/op_mode')
-rwxr-xr-xsrc/op_mode/ipsec.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/op_mode/ipsec.py b/src/op_mode/ipsec.py
index 7ec35d7bd..aaa0cec5a 100755
--- a/src/op_mode/ipsec.py
+++ b/src/op_mode/ipsec.py
@@ -43,7 +43,10 @@ def _alphanum_key(key):
def _get_vici_sas():
from vici import Session as vici_session
- session = vici_session()
+ try:
+ session = vici_session()
+ except Exception:
+ raise vyos.opmode.UnconfiguredSubsystem("IPsec not initialized")
sas = list(session.list_sas())
return sas