From 10c06217a53b28a3b481c451e65da62e9b531a24 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 6 Apr 2020 07:24:11 +0200 Subject: 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. --- src/conf_mode/ipsec-settings.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/conf_mode') 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) -- cgit v1.2.3