mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02: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,8 +76,11 @@ 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.')
|
||||
else:
|
||||
return a
|
||||
|
||||
def bool(a):
|
||||
|
|
Loading…
Reference in a new issue