From a7599954a334b2666858b2a571b59aa2cebd9a11 Mon Sep 17 00:00:00 2001 From: Jeroen Hoekx Date: Wed, 9 May 2012 16:13:20 +0200 Subject: [PATCH] Make no_engine the default templating action. --- lib/ansible/runner.py | 2 +- lib/ansible/utils.py | 2 +- test/TestUtils.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ansible/runner.py b/lib/ansible/runner.py index 135130c5750..aef135b3c5c 100644 --- a/lib/ansible/runner.py +++ b/lib/ansible/runner.py @@ -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) diff --git a/lib/ansible/utils.py b/lib/ansible/utils.py index 83852804079..6fb4c78aa4d 100644 --- a/lib/ansible/utils.py +++ b/lib/ansible/utils.py @@ -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) diff --git a/test/TestUtils.py b/test/TestUtils.py index 23459d84a21..42953b854a1 100644 --- a/test/TestUtils.py +++ b/test/TestUtils.py @@ -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'