Commit 3cf0c09c by Nicolas Rémond

Variables lookup in a template should handle properly the undefined case

parent f88e2e1f
......@@ -93,6 +93,8 @@ def lookup(name, *args, **kwargs):
ran = instance.run(*args, inject=tvars, **kwargs)
except errors.AnsibleError:
raise
except jinja2.exceptions.UndefinedError, e:
raise errors.AnsibleUndefinedVariable("One or more undefined variables: %s" % str(e))
except Exception, e:
raise errors.AnsibleError('Unexpected error in during lookup: %s' % e)
if ran:
......
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