From 562f4c276215cb8175aea1af8b279bd8e2a21171 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 11 Jul 2021 20:07:50 +0200 Subject: ipsec: T2816: use common "if key in dict:" pattern --- src/conf_mode/ipsec-settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/conf_mode') diff --git a/src/conf_mode/ipsec-settings.py b/src/conf_mode/ipsec-settings.py index 1951bdf6e..0599bf101 100755 --- a/src/conf_mode/ipsec-settings.py +++ b/src/conf_mode/ipsec-settings.py @@ -137,7 +137,7 @@ def check_cert_file_store(cert_name, file_path, dts_path): def verify(data): # l2tp ipsec check - if data["ipsec_l2tp"]: + if 'ipsec_l2tp' in data: # Checking dependecies for "authentication mode pre-shared-secret" if data.get("ipsec_l2tp_auth_mode") == "pre-shared-secret": if not data.get("ipsec_l2tp_secret"): @@ -166,7 +166,7 @@ def verify(data): raise ConfigError("L2TP VPN configuration error: \"vpn ipsec ipsec-interfaces\" must be specified.") def generate(data): - if data["ipsec_l2tp"]: + if 'ipsec_l2tp' in data: remove_confs(delim_ipsec_l2tp_begin, delim_ipsec_l2tp_end, ipsec_secrets_file) # old_umask = os.umask(0o077) # render(ipsec_secrets_file, 'ipsec/ipsec.secrets.tmpl', data) -- cgit v1.2.3