Unmounts ZFS file systems

    name : string
        name of the filesystem, you can use None to unmount all mounted filesystems.
    force : boolean
        forcefully unmount the file system, even if it is currently in use.

    .. warning::

        Using ``-a`` for the name parameter will probably break your system, unless your rootfs is not on zfs.

    .. versionadded:: 2016.3.0
    .. versionchanged:: 2018.3.1

    .. warning::

            Passing '-a' as name is deprecated and will be removed in Sodium.

    CLI Example:

    .. code-block:: bash

        salt '*' zfs.unmount myzpool/mydataset [force=True|False]

def unmount(name, **kwargs):
    '''
    Unmounts ZFS file systems

    name : string
        name of the filesystem, you can use None to unmount all mounted filesystems.
    force : boolean
        forcefully unmount the file system, even if it is currently in use.

    .. warning::

        Using ``-a`` for the name parameter will probably break your system, unless your rootfs is not on zfs.

    .. versionadded:: 2016.3.0
    .. versionchanged:: 2018.3.1

    .. warning::

            Passing '-a' as name is deprecated and will be removed in Sodium.

    CLI Example:

    .. code-block:: bash

        salt '*' zfs.unmount myzpool/mydataset [force=True|False]

    '''
    ## Configure command
    # NOTE: initialize the defaults
    flags = []

    # NOTE: set extra config from kwargs
    if kwargs.get('force', False):
        flags.append('-f')
    if name in [None, '-a']:
        # NOTE: still accept '-a' as name for backwards compatibility
        #       until Salt Sodium this should just simplify
        #       this to just set '-a' if name is not set.
        flags.append('-a')
        name = None

    ## Unmount filesystem
    res = __salt__['cmd.run_all'](
        __utils__['zfs.zfs_command'](
            command='unmount',
            flags=flags,
            target=name,
        ),
        python_shell=False,
    )

    return __utils__['zfs.parse_command_result'](res, 'unmounted')