Introduce exception AnsibleFilterError and use it in Jinja filters. Ignore this exception when trying to find the name of a task for display (callback) purpose.

This commit is contained in:
Stoned Elipot
2013-07-07 19:18:32 +02:00
parent b2d881a899
commit 2d88c70cd5
4 changed files with 43 additions and 34 deletions

View File

@@ -33,7 +33,7 @@ def to_nice_json(*a, **kw):
def failed(*a, **kw):
item = a[0]
if type(item) != dict:
raise errors.AnsibleError("|failed expects a dictionary")
raise errors.AnsibleFilterError("|failed expects a dictionary")
rc = item.get('rc',0)
failed = item.get('failed',False)
if rc != 0 or failed: