Commit 2fda9bc7 by Jack Neely

template.py: Handle purposely raised exceptions in lookup()

If a lookup plugin is run by the lookup() template method it should pass
along any AnsibleError (or child exception classes) rather than just eat
them.  These exceptions are purposely raised by the plugin.
parent 7da68bb2
......@@ -91,6 +91,9 @@ def lookup(name, *args, **kwargs):
# safely catch run failures per #5059
try:
ran = instance.run(*args, inject=vars, **kwargs)
except errors.AnsibleError:
# Plugin raised this on purpose
raise
except Exception, e:
ran = None
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