summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-03-01 20:57:23 +0100
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-03-01 20:58:16 +0100
commit47bd97b8cf09c26619e106874eab6c84b5060f67 (patch)
tree854a5a597a900724b3c82328b8ef502acfb98b04 /config
parentd7603817b4d82b3e4c493d9f4c2367b84c8f1e23 (diff)
generate_config: Enable 'do' j2 extension
'do' is useful to avoid hacks like {% set _ = x.update(...) %}. Instead: {% do x.update(...) %}. [1] http://jinja.pocoo.org/docs/2.10/extensions/ Change-Id: I886beb97e0383ba11b81aa21cf12b11ebc4b05b2 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'config')
-rwxr-xr-xconfig/utils/generate_config.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/config/utils/generate_config.py b/config/utils/generate_config.py
index f1c395a5..6adbb44e 100755
--- a/config/utils/generate_config.py
+++ b/config/utils/generate_config.py
@@ -23,7 +23,10 @@ PARSER.add_argument("--yaml", "-y", type=str, required=True)
PARSER.add_argument("--jinja2", "-j", type=str, required=True)
ARGS = PARSER.parse_args()
-ENV = Environment(loader=FileSystemLoader(os.path.dirname(ARGS.jinja2)))
+ENV = Environment(
+ loader=FileSystemLoader(os.path.dirname(ARGS.jinja2)),
+ extensions=['jinja2.ext.do']
+)
gen_config_lib.load_custom_filters(ENV)
# Run `eyaml decrypt` on the whole file, but only if PDF data is encrypted