Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Added to_json filter to Jinja2 environment when run through template_from_file #980

Closed
wants to merge 1 commit into from

2 participants

@tima

This is a follow-up to #956.

@mpdehaan

jp_mens fixed the previous applied patch last night, should be good to go if you revert this commit and pull again.

Thanks!

@mpdehaan mpdehaan closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 31, 2012
  1. @tima
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0  lib/ansible/utils.py
View
1  lib/ansible/utils.py
@@ -211,6 +211,7 @@ 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['to_json'] = json.dumps
data = codecs.open(path_dwim(basedir, path), encoding="utf8").read()
t = environment.from_string(data)
vars = vars.copy()
Something went wrong with that request. Please try again.