From 413e24400c54f398ef73347df2e877aef422400e Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Thu, 27 Oct 2022 13:57:25 -0500 Subject: ipsec: T4778: raise UnconfiguredSubsystem if IPsec not initialized --- src/op_mode/ipsec.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3