From c5e9347c6572c1d3a31b987263d1cc583a7e356c Mon Sep 17 00:00:00 2001 From: Christophe Drevet-Droguet Date: Fri, 6 Dec 2013 14:32:26 +0100 Subject: [PATCH] report umount because of different device - Fails if the wrong device couldn't be unmounted - Reports unmounting the wrong device --- salt/states/mount.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/salt/states/mount.py b/salt/states/mount.py index 4914e045b6..6687e00495 100644 --- a/salt/states/mount.py +++ b/salt/states/mount.py @@ -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