Commit 4753804a by James Cammarata

Merge pull request #6332 from jimi-c/issue_6329_space_in_var

Correctly catch template errors without returning invalid data
parents e3b887f7 3cd7d47b
......@@ -316,6 +316,8 @@ def template_from_string(basedir, data, vars, fail_on_undefined=False):
except Exception, e:
if 'recursion' in str(e):
raise errors.AnsibleError("recursive loop detected in template string: %s" % data)
elif isinstance(e, TemplateSyntaxError):
raise errors.AnsibleError("there was an error in the template: %s" % data)
else:
return data
......
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