mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Merge pull request #9793 from nremond/devel
Variables lookup in a template should handle properly the undefined case
This commit is contained in:
@@ -93,6 +93,8 @@ def lookup(name, *args, **kwargs):
|
|||||||
ran = instance.run(*args, inject=tvars, **kwargs)
|
ran = instance.run(*args, inject=tvars, **kwargs)
|
||||||
except errors.AnsibleError:
|
except errors.AnsibleError:
|
||||||
raise
|
raise
|
||||||
|
except jinja2.exceptions.UndefinedError, e:
|
||||||
|
raise errors.AnsibleUndefinedVariable("One or more undefined variables: %s" % str(e))
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
raise errors.AnsibleError('Unexpected error in during lookup: %s' % e)
|
raise errors.AnsibleError('Unexpected error in during lookup: %s' % e)
|
||||||
if ran:
|
if ran:
|
||||||
|
|||||||
Reference in New Issue
Block a user