Fixing traceback caused by incorrect argument passing to json.dumps

Fixes #5756
This commit is contained in:
James Cammarata 2014-01-27 11:28:07 -06:00
commit 3fddd78ec5
2 changed files with 9 additions and 3 deletions

View file

@ -547,6 +547,8 @@ def template_from_string(basedir, data, vars, fail_on_undefined=False):
except TypeError, te:
if 'StrictUndefined' in str(te):
raise errors.AnsibleUndefinedVariable("unable to look up a name or access an attribute in template string")
else:
raise errors.AnsibleError("an unexpected type error occured. Error was %s" % te)
return res
except (jinja2.exceptions.UndefinedError, errors.AnsibleUndefinedVariable):
if fail_on_undefined: