From 7ce6ad4486912dc76c5999f420897efe2747cabb Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Sun, 4 Dec 2022 13:29:00 +0000 Subject: T4860: Verify if mode in openconnect ocserv dict openconnect authentication mode must be set check dict that 'mode' exists in openconnect authentication --- src/conf_mode/vpn_openconnect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/conf_mode/vpn_openconnect.py') diff --git a/src/conf_mode/vpn_openconnect.py b/src/conf_mode/vpn_openconnect.py index c050b796b..845250dd4 100755 --- a/src/conf_mode/vpn_openconnect.py +++ b/src/conf_mode/vpn_openconnect.py @@ -58,7 +58,7 @@ def get_config(): default_values = defaults(base) ocserv = dict_merge(default_values, ocserv) - if "local" in ocserv["authentication"]["mode"]: + if 'mode' in ocserv["authentication"] and "local" in ocserv["authentication"]["mode"]: # workaround a "know limitation" - https://phabricator.vyos.net/T2665 del ocserv['authentication']['local_users']['username']['otp'] if not ocserv["authentication"]["local_users"]["username"]: -- cgit v1.2.3