summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDmitriyEshenko <dmitriy.eshenko@vyos.io>2020-01-14 15:02:04 +0000
committerDmitriyEshenko <dmitriy.eshenko@vyos.io>2020-01-14 15:02:04 +0000
commit8958e15d3b8cac29f3088cc8253271e3449c0a21 (patch)
tree872503b256d1d6aad0ae781d2b85ff325202acbf /src
parent91de4ec9d95a6a99df0ad5363633251bcb5f4874 (diff)
downloadvyos-1x-8958e15d3b8cac29f3088cc8253271e3449c0a21.tar.gz
vyos-1x-8958e15d3b8cac29f3088cc8253271e3449c0a21.zip
ipsec: T1959: Check file existence before changes
Diffstat (limited to 'src')
-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)