summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-06 07:24:11 +0200
committerChristian Poessinger <christian@poessinger.com>2020-04-06 07:24:11 +0200
commit10c06217a53b28a3b481c451e65da62e9b531a24 (patch)
treecc3948a72ed185240dc0bd86492e725bd9f91a1f
parent960e9e0bc0aba72f748ee880dbf9fc3a22dafc5b (diff)
downloadvyos-1x-10c06217a53b28a3b481c451e65da62e9b531a24.tar.gz
vyos-1x-10c06217a53b28a3b481c451e65da62e9b531a24.zip
ipsec: T2230: bugfix rewriting Jinja2 code
Commit dbc174d ("ipsec: T2230: move inlined templates to dedicated files") did not alter existing code which was used for template processing.
-rwxr-xr-xsrc/conf_mode/ipsec-settings.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/conf_mode/ipsec-settings.py b/src/conf_mode/ipsec-settings.py
index 1ebf6a5cd..2fa27022b 100755
--- a/src/conf_mode/ipsec-settings.py
+++ b/src/conf_mode/ipsec-settings.py
@@ -147,8 +147,8 @@ def verify(data):
def generate(data):
tmpl_path = os.path.join(vyos_data_dir['data'], 'templates', 'ipsec')
- fs_loader = jinja2.FileSystemLoader(tmpl_path)
- env = jinja2.Environment(loader=fs_loader, trim_blocks=True)
+ fs_loader = FileSystemLoader(tmpl_path)
+ env = Environment(loader=fs_loader, trim_blocks=True)
tmpl = env.get_template('charon.tmpl')
config_text = tmpl.render(data)
@@ -182,7 +182,7 @@ def generate(data):
l2pt_ipsec_conf_txt = tmpl.render(c)
old_umask = os.umask(0o077)
with open(ipsec_conf_flie,'a') as f:
- .write(l2pt_ipsec_conf_txt)
+ f.write(l2pt_ipsec_conf_txt)
os.umask(old_umask)
append_ipsec_conf(data)