check for mandatory parameters to avoid false positives

This commit is contained in:
Frantisek Holop 2018-08-21 16:08:10 +02:00
parent 5ba7f60f03
commit ec2a091376

View file

@ -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: