summaryrefslogtreecommitdiff
path: root/src/conf_mode/vpn_l2tp.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-11 19:13:39 +0200
committerChristian Poessinger <christian@poessinger.com>2020-04-11 19:13:39 +0200
commit0edca98b751faa3f3817fe4899d2822daade4212 (patch)
tree673436a5f0f11661750811bd03e16dd034f2cd7c /src/conf_mode/vpn_l2tp.py
parent07080afd4015a900fb7474e1c81008f58b478565 (diff)
downloadvyos-1x-0edca98b751faa3f3817fe4899d2822daade4212.tar.gz
vyos-1x-0edca98b751faa3f3817fe4899d2822daade4212.zip
vpn: l2tp: sstp: T2264: create config dir on demand
Diffstat (limited to 'src/conf_mode/vpn_l2tp.py')
-rwxr-xr-xsrc/conf_mode/vpn_l2tp.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/conf_mode/vpn_l2tp.py b/src/conf_mode/vpn_l2tp.py
index 7cfb4e74e..7ecd8b2a4 100755
--- a/src/conf_mode/vpn_l2tp.py
+++ b/src/conf_mode/vpn_l2tp.py
@@ -349,6 +349,10 @@ def generate(l2tp):
fs_loader = FileSystemLoader(tmpl_path)
env = Environment(loader=fs_loader, trim_blocks=True)
+ dirname = os.path.dirname(l2tp_conf)
+ if not os.path.exists(dirname):
+ os.mkdir(dirname)
+
tmpl = env.get_template('l2tp.config.tmpl')
config_text = tmpl.render(c)
with open(l2tp_conf, 'w') as f: