Attempt to unmount a device by specifying the directory it is mounted on

    CLI Example:

    .. code-block:: bash

        salt '*' mount.umount /mnt/foo

    .. versionadded:: 2015.5.0
    .. code-block:: bash

        salt '*' mount.umount /mnt/foo /dev/xvdc1

def umount(name, device=None, user=None, util='mount'):
    '''
    Attempt to unmount a device by specifying the directory it is mounted on

    CLI Example:

    .. code-block:: bash

        salt '*' mount.umount /mnt/foo

    .. versionadded:: 2015.5.0
    .. code-block:: bash

        salt '*' mount.umount /mnt/foo /dev/xvdc1
    '''
    if util != 'mount':
        # This functionality used to live in img.umount_image
        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