From a37c6ea936728c5859787c0953cf2c12b2e01d0e Mon Sep 17 00:00:00 2001 From: Jan-Piet Mens Date: Fri, 31 Aug 2012 07:30:18 +0200 Subject: [PATCH] Jinja2 filter from_json added, to_json renamed --- lib/ansible/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/utils.py b/lib/ansible/utils.py index 65bc704f499..ca0f1b455db 100644 --- a/lib/ansible/utils.py +++ b/lib/ansible/utils.py @@ -241,7 +241,8 @@ def template_from_file(basedir, path, vars): ''' run a file through the templating engine ''' environment = jinja2.Environment(loader=jinja2.FileSystemLoader(basedir), trim_blocks=False) - environment.filters['tojson'] = json.dumps + environment.filters['to_json'] = json.dumps + environment.filters['from_json'] = json.loads data = codecs.open(path_dwim(basedir, path), encoding="utf8").read() t = environment.from_string(data) vars = vars.copy()