moved override matching string to variable changed test template to match Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>

Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
pull/1683/head
Brian Coca 12 years ago committed by Brian Coca
parent d751d88b48
commit 6a1e2aaff5

@ -31,7 +31,7 @@ import pwd
# TODO: refactor this file # TODO: refactor this file
_LISTRE = re.compile(r"(\w+)\[(\d+)\]") _LISTRE = re.compile(r"(\w+)\[(\d+)\]")
JINJA2_OVERRIDE='#jinja2:'
def _varFindLimitSpace(basedir, vars, space, part, depth): def _varFindLimitSpace(basedir, vars, space, part, depth):
''' limits the search space of space to part ''' limits the search space of space to part
@ -277,7 +277,7 @@ def template_from_file(basedir, path, vars):
raise errors.AnsibleError("unable to read %s" % realpath) raise errors.AnsibleError("unable to read %s" % realpath)
# Get jinja env overrides from template # Get jinja env overrides from template
if data.startswith('#env:'): if data.startswith(JINJA2_OVERRIDE):
eol = data.find('\n') eol = data.find('\n')
line = data[5:eol] line = data[5:eol]
data = data[eol+1:] data = data[eol+1:]

@ -1,4 +1,4 @@
#env: variable_end_string: @@, variable_start_string: @@ #jinja2: variable_end_string: @@, variable_start_string: @@
{% raw %} {% raw %}
if this succeeds you should see '{{ ansible_hostname }}' with the hostname on the line above if this succeeds you should see '{{ ansible_hostname }}' with the hostname on the line above

Loading…
Cancel
Save