Commit a7599954 by Jeroen Hoekx

Make no_engine the default templating action.

parent 53bde0bf
...@@ -545,7 +545,7 @@ class Runner(object): ...@@ -545,7 +545,7 @@ class Runner(object):
source_data = file(utils.path_dwim(self.basedir, source)).read() source_data = file(utils.path_dwim(self.basedir, source)).read()
resultant = '' resultant = ''
try: try:
resultant = utils.template(source_data, inject, self.setup_cache) resultant = utils.template(source_data, inject, self.setup_cache, no_engine=False)
except Exception, e: except Exception, e:
return (host, False, dict(failed=True, msg=str(e)), '') return (host, False, dict(failed=True, msg=str(e)), '')
xfered = self._transfer_str(conn, tmp, 'source', resultant) xfered = self._transfer_str(conn, tmp, 'source', resultant)
......
...@@ -243,7 +243,7 @@ def varReplace(raw, vars): ...@@ -243,7 +243,7 @@ def varReplace(raw, vars):
return ''.join(done) return ''.join(done)
def template(text, vars, setup_cache, no_engine=False): def template(text, vars, setup_cache, no_engine=True):
''' run a text buffer through the templating engine ''' ''' run a text buffer through the templating engine '''
vars = vars.copy() vars = vars.copy()
text = varReplace(str(text), vars) text = varReplace(str(text), vars)
......
...@@ -140,7 +140,7 @@ class TestUtils(unittest.TestCase): ...@@ -140,7 +140,7 @@ class TestUtils(unittest.TestCase):
'who': 'world', 'who': 'world',
} }
res = ansible.utils.template(template, vars, {}) res = ansible.utils.template(template, vars, {}, no_engine=False)
assert res == 'hello world' assert res == 'hello world'
...@@ -150,6 +150,6 @@ class TestUtils(unittest.TestCase): ...@@ -150,6 +150,6 @@ class TestUtils(unittest.TestCase):
'who': 'world', 'who': 'world',
} }
res = ansible.utils.template(template, vars, {}) res = ansible.utils.template(template, vars, {}, no_engine=False)
assert res == 'hello world\n' assert res == 'hello world\n'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment