summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas RĂ©mond <nremond+github@gmail.com>2014-12-12 12:11:17 +0100
committerJames Cammarata <jimi@sngx.net>2015-02-17 13:34:52 -0600
commit4fa5db9a0317fbaaf5e95b5081784659a891d005 (patch)
tree0013029e4196719d804348c63531c2472281a355
parent25801f939b0197620ec8883d96a396c3601a040c (diff)
downloadansible-4fa5db9a0317fbaaf5e95b5081784659a891d005.tar.gz
Variables lookup in a template should handle properly the undefined case
-rw-r--r--lib/ansible/utils/template.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/ansible/utils/template.py b/lib/ansible/utils/template.py
index 3e7f5e4d81..0098aa8b89 100644
--- a/lib/ansible/utils/template.py
+++ b/lib/ansible/utils/template.py
@@ -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: