Merge pull request #7608 from jjneely/lookup-function

template.py: Handle purposely raised exceptions in lookup()
pull/4420/head
Michael DeHaan 2014-05-30 22:24:53 -04:00
commit 959af67fe3
1 changed files with 3 additions and 0 deletions

View File

@ -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: