report umount because of different device

- Fails if the wrong device couldn't be unmounted
- Reports unmounting the wrong device
This commit is contained in:
Christophe Drevet-Droguet 2013-12-06 14:32:26 +01:00
parent 320bc4f0d9
commit c5e9347c65

View File

@ -93,6 +93,12 @@ def mounted(name,
# name matches but device doesn't - need to umount
out = __salt__['mount.umount'](real_name)
active = __salt__['mount.active']()
if real_name in active:
ret['comment'] = "Unable to unmount (mount point name matches but device doesn't)"
ret['result'] = None
return ret
else:
ret['changes']['umount'] = "Forced umount because mount point name matches but device doesn't"
else:
ret['comment'] = 'Target was already mounted'
# using a duplicate check so I can catch the results of a umount