summaryrefslogtreecommitdiff
path: root/src/conf_mode/ipsec-settings.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2020-01-14 13:33:13 -0600
committerGitHub <noreply@github.com>2020-01-14 13:33:13 -0600
commitf7c3e427c19a0137f76a3291c888a21239b3a0db (patch)
tree9d6833097cf000f8c4d43d6ed2d1c1810fe1cfea /src/conf_mode/ipsec-settings.py
parent29e3f990303c6d01c37f4fafc44d0d3cbcd4558e (diff)
parent8958e15d3b8cac29f3088cc8253271e3449c0a21 (diff)
downloadvyos-1x-f7c3e427c19a0137f76a3291c888a21239b3a0db.tar.gz
vyos-1x-f7c3e427c19a0137f76a3291c888a21239b3a0db.zip
Merge pull request #206 from DmitriyEshenko/fix-ipsec-set
ipsec: T1959: Check file existence before changes
Diffstat (limited to 'src/conf_mode/ipsec-settings.py')
-rwxr-xr-xsrc/conf_mode/ipsec-settings.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/conf_mode/ipsec-settings.py b/src/conf_mode/ipsec-settings.py
index aab3e9734..e80c6caf0 100755
--- a/src/conf_mode/ipsec-settings.py
+++ b/src/conf_mode/ipsec-settings.py
@@ -248,7 +248,8 @@ def generate(data):
write_ipsec_ra_conn(data)
append_ipsec_conf(data)
else:
- remove_confs(delim_ipsec_l2tp_begin, delim_ipsec_l2tp_end, ipsec_ra_conn_file)
+ if os.path.exists(ipsec_ra_conn_file):
+ remove_confs(delim_ipsec_l2tp_begin, delim_ipsec_l2tp_end, ipsec_ra_conn_file)
remove_confs(delim_ipsec_l2tp_begin, delim_ipsec_l2tp_end, ipsec_secrets_flie)
remove_confs(delim_ipsec_l2tp_begin, delim_ipsec_l2tp_end, ipsec_conf_flie)