1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Treat a False mandatory variable as defined.

This commit is contained in:
Deon Bredenhann 2013-12-31 13:41:40 +02:00
parent 4f1f13b100
commit c85aac8b17

View file

@ -76,9 +76,12 @@ def skipped(*a, **kw):
def mandatory(a):
''' Make a variable mandatory '''
if not a:
try:
a
except NameError:
raise errors.AnsibleFilterError('Mandatory variable not defined.')
return a
else:
return a
def bool(a):
''' return a bool for the arg '''