Make no_engine the default templating action.

This commit is contained in:
Jeroen Hoekx 2012-05-09 16:13:20 +02:00
parent 82144fd543
commit 2bbc05185e
3 changed files with 4 additions and 4 deletions

View file

@ -545,7 +545,7 @@ class Runner(object):
source_data = file(utils.path_dwim(self.basedir, source)).read()
resultant = ''
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:
return (host, False, dict(failed=True, msg=str(e)), '')
xfered = self._transfer_str(conn, tmp, 'source', resultant)

View file

@ -243,7 +243,7 @@ def varReplace(raw, vars):
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 '''
vars = vars.copy()
text = varReplace(str(text), vars)

View file

@ -140,7 +140,7 @@ class TestUtils(unittest.TestCase):
'who': 'world',
}
res = ansible.utils.template(template, vars, {})
res = ansible.utils.template(template, vars, {}, no_engine=False)
assert res == 'hello world'
@ -150,6 +150,6 @@ class TestUtils(unittest.TestCase):
'who': 'world',
}
res = ansible.utils.template(template, vars, {})
res = ansible.utils.template(template, vars, {}, no_engine=False)
assert res == 'hello world\n'