mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Variables lookup in a template should handle properly the undefined case
This commit is contained in:
parent
f88e2e1f01
commit
3cf0c09ce9
1 changed files with 2 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue