def umount(name, device=None, user=None, util='mount'):
 if (util != 'mount'):
  if ('qemu_nbd.clear' in __salt__):
   if ('img.mnt_{0}'.format(name) in __context__):
    __salt__['qemu_nbd.clear'](__context__['img.mnt_{0}'.format(name)])
    return
 mnts = active()
 if (name not in mnts):
  return '{0} does not have anything mounted'.format(name)
 if (not device):
  cmd = 'umount {0}'.format(name)
 else:
  cmd = 'umount {0}'.format(device)
 out = __salt__['cmd.run_all'](cmd, runas=user, python_shell=False)
 if out['retcode']:
  return out['stderr']
 return True

def umount ( name , device = None , user = None , util = 'mount' ) : if ( util != 'mount' ) : if ( 'qemu_nbd.clear' in __salt__ ) : if ( 'img.mnt_{0}' . format ( name ) in __context__ ) : __salt__ [ 'qemu_nbd.clear' ] ( __context__ [ 'img.mnt_{0}' . format ( name ) ] ) return mnts = active ( ) if ( name not in mnts ) : return '{0} does not have anything mounted' . format ( name ) if ( not device ) : cmd = 'umount {0}' . format ( name ) else : cmd = 'umount {0}' . format ( device ) out = __salt__ [ 'cmd.run_all' ] ( cmd , runas = user , python_shell = False ) if out [ 'retcode' ] : return out [ 'stderr' ] return True
unmount a path .