summaryrefslogtreecommitdiff
path: root/src/conf_mode/ipsec-settings.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-07-11 20:07:50 +0200
committerChristian Poessinger <christian@poessinger.com>2021-07-11 20:07:50 +0200
commit562f4c276215cb8175aea1af8b279bd8e2a21171 (patch)
tree4d82f5017566ed4fdbbd9757135600e068129241 /src/conf_mode/ipsec-settings.py
parentbffd2687fa5594dac53a0c7047adc6ff1b16bd75 (diff)
downloadvyos-1x-562f4c276215cb8175aea1af8b279bd8e2a21171.tar.gz
vyos-1x-562f4c276215cb8175aea1af8b279bd8e2a21171.zip
ipsec: T2816: use common "if key in dict:" pattern
Diffstat (limited to 'src/conf_mode/ipsec-settings.py')
-rwxr-xr-xsrc/conf_mode/ipsec-settings.py4
1 files changed, 2 insertions, 2 deletions
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)