mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Use AnsibleFilterError exception
This commit is contained in:
parent
0f26439234
commit
667ad2480e
1 changed files with 2 additions and 2 deletions
|
@ -48,14 +48,14 @@ def success(*a, **kw):
|
||||||
def skipped(*a, **kw):
|
def skipped(*a, **kw):
|
||||||
item = a[0]
|
item = a[0]
|
||||||
if type(item) != dict:
|
if type(item) != dict:
|
||||||
raise errors.AnsibleError("|skipped expects a dictionary")
|
raise errors.AnsibleFilterError("|skipped expects a dictionary")
|
||||||
skipped = item.get('skipped', False)
|
skipped = item.get('skipped', False)
|
||||||
return skipped
|
return skipped
|
||||||
|
|
||||||
def mandatory(a):
|
def mandatory(a):
|
||||||
''' Make a variable mandatory '''
|
''' Make a variable mandatory '''
|
||||||
if not a:
|
if not a:
|
||||||
raise errors.AnsibleError('Mandatory variable not defined.')
|
raise errors.AnsibleFilterError('Mandatory variable not defined.')
|
||||||
return a
|
return a
|
||||||
|
|
||||||
def bool(a):
|
def bool(a):
|
||||||
|
|
Loading…
Reference in a new issue