Treat a False mandatory variable as defined.
This commit is contained in:
parent
4f1f13b100
commit
c85aac8b17
1 changed files with 5 additions and 2 deletions
|
@ -76,8 +76,11 @@ def skipped(*a, **kw):
|
||||||
|
|
||||||
def mandatory(a):
|
def mandatory(a):
|
||||||
''' Make a variable mandatory '''
|
''' Make a variable mandatory '''
|
||||||
if not a:
|
try:
|
||||||
|
a
|
||||||
|
except NameError:
|
||||||
raise errors.AnsibleFilterError('Mandatory variable not defined.')
|
raise errors.AnsibleFilterError('Mandatory variable not defined.')
|
||||||
|
else:
|
||||||
return a
|
return a
|
||||||
|
|
||||||
def bool(a):
|
def bool(a):
|
||||||
|
|
Loading…
Reference in a new issue