mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-11 16:44:22 -07:00
Merge pull request #5465 from deonbredenhann/false_mandatory_variable
Treat a False mandatory variable as defined.
This commit is contained in:
commit
91c5c9da08
1 changed files with 6 additions and 3 deletions
|
@ -76,9 +76,12 @@ 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.')
|
||||||
return a
|
else:
|
||||||
|
return a
|
||||||
|
|
||||||
def bool(a):
|
def bool(a):
|
||||||
''' return a bool for the arg '''
|
''' return a bool for the arg '''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue