1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Catch all exceptions coming from lookup plugins

Fixes using $TEMPLATE() and hostvars in a task without a name, among
other things.
This commit is contained in:
Daniel Hokka Zakrisson 2013-02-27 10:08:45 +01:00
parent b1a4fab7e1
commit bcf7a2c53a

View file

@ -175,7 +175,7 @@ def _varFind(basedir, text, vars, lookup_fatal, depth, expand_lists):
replacement = instance.run(args, inject=vars) replacement = instance.run(args, inject=vars)
if expand_lists: if expand_lists:
replacement = u",".join([unicode(x) for x in replacement]) replacement = u",".join([unicode(x) for x in replacement])
except errors.AnsibleError: except:
if not lookup_fatal: if not lookup_fatal:
replacement = None replacement = None
else: else: