mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
check for mandatory parameters to avoid false positives
This commit is contained in:
parent
5ba7f60f03
commit
ec2a091376
1 changed files with 20 additions and 0 deletions
|
@ -186,6 +186,21 @@ def mounted(name,
|
|||
'result': True,
|
||||
'comment': ''}
|
||||
|
||||
if not name:
|
||||
ret['result'] = False
|
||||
ret['comment'] = 'Must provide name to mount.mounted'
|
||||
return ret
|
||||
|
||||
if not device:
|
||||
ret['result'] = False
|
||||
ret['comment'] = 'Must provide device to mount.mounted'
|
||||
return ret
|
||||
|
||||
if not fstype:
|
||||
ret['result'] = False
|
||||
ret['comment'] = 'Must provide fstype to mount.mounted'
|
||||
return ret
|
||||
|
||||
if device_name_regex is None:
|
||||
device_name_regex = []
|
||||
|
||||
|
@ -720,6 +735,11 @@ def unmounted(name,
|
|||
'result': True,
|
||||
'comment': ''}
|
||||
|
||||
if not name:
|
||||
ret['result'] = False
|
||||
ret['comment'] = 'Must provide name to mount.unmounted'
|
||||
return ret
|
||||
|
||||
# Get the active data
|
||||
active = __salt__['mount.active'](extended=True)
|
||||
if name not in active:
|
||||
|
|
Loading…
Add table
Reference in a new issue