mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Add a umount function
Does the opposite of mount. Fancy that :)
This commit is contained in:
parent
5f89a958ba
commit
08a5496b1e
@ -256,6 +256,24 @@ def remount(name, device, mkmnt=False, fstype='', opts='defaults'):
|
||||
return mount(name, device, mkmnt, fstype, opts)
|
||||
|
||||
|
||||
def umount(name):
|
||||
'''
|
||||
Attempt to unmount a device by specifying the directory it is mounted on
|
||||
|
||||
CLI Example::
|
||||
|
||||
salt '*' mount.umount /mnt/foo
|
||||
'''
|
||||
mnts = active()
|
||||
if name not in mnts:
|
||||
return "{0} does not have anything mounted".format(name)
|
||||
|
||||
cmd = 'umount {0}'.format(name)
|
||||
out = __salt__['cmd.run_all'](cmd)
|
||||
if out['retcode']:
|
||||
return out['stderr']
|
||||
return True
|
||||
|
||||
def is_fuse_exec(cmd):
|
||||
'''
|
||||
Returns true if the command passed is a fuse mountable application.
|
||||
|
Loading…
Reference in New Issue
Block a user