From 2fda9bc743b66c676f07df7cc1f50bcbbdf39488 Mon Sep 17 00:00:00 2001 From: Jack Neely Date: Fri, 30 May 2014 16:41:20 -0400 Subject: [PATCH] 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. --- lib/ansible/utils/template.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/utils/template.py b/lib/ansible/utils/template.py index 8ec27ac0976..7848dd158ac 100644 --- a/lib/ansible/utils/template.py +++ b/lib/ansible/utils/template.py @@ -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: