summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael DeHaan <michael@ansibleworks.com>2013-10-31 19:39:32 -0400
committerMichael DeHaan <michael@ansibleworks.com>2013-10-31 19:39:32 -0400
commit51fbc6d20a18af47d1a98e07a0b60071c9751c94 (patch)
tree59eb634144b07e3df806b9ac77cd3e37cb9cf03e
parentbbf212a268f0ec4396d225a1e9775c514c1c53cd (diff)
downloadansible-51fbc6d20a18af47d1a98e07a0b60071c9751c94.tar.gz
Further simplify the debug: var=foo action plugin code.
-rw-r--r--lib/ansible/runner/action_plugins/debug.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/ansible/runner/action_plugins/debug.py b/lib/ansible/runner/action_plugins/debug.py
index 075b1cc76f..ee9c6ec32b 100644
--- a/lib/ansible/runner/action_plugins/debug.py
+++ b/lib/ansible/runner/action_plugins/debug.py
@@ -18,6 +18,7 @@
import ansible
from ansible import utils
+from ansible.utils import template
from ansible.runner.return_data import ReturnData
class ActionModule(object):
@@ -49,14 +50,8 @@ class ActionModule(object):
else:
result = dict(msg=args['msg'])
elif 'var' in args:
-
- results = utils.safe_eval(args['var'], inject, include_exceptions=True)
- intermediate = results[0]
- exception = results[1]
- print exception
- if exception is not None:
- intermediate = "failed to evaluate: %s" % str(exception)
- result[args['var']] = intermediate
+ results = template.template(None, "{{ %s }}" % args['var'], inject)
+ result[args['var']] = results
# force flag to make debug output module always verbose
result['verbose_always'] = True