Merge pull request #3462 from stoned/filtererror

Introduce exception AnsibleFilterError and use it in Jinja filters.  Ign...
This commit is contained in:
Michael DeHaan 2013-07-20 09:12:26 -07:00
commit 0f4229f6c4
4 changed files with 43 additions and 34 deletions

View file

@ -34,7 +34,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: