Scrub a storage pool

    zpool : string
        Name of storage pool

    stop : boolean
        If ``True``, cancel ongoing scrub

    pause : boolean
        If ``True``, pause ongoing scrub

        .. versionadded:: 2018.3.0

        .. note::

            Pause is only available on recent versions of ZFS.

            If both ``pause`` and ``stop`` are ``True``, then ``stop`` will
            win.

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.scrub myzpool

def scrub(zpool, stop=False, pause=False):
    '''
    Scrub a storage pool

    zpool : string
        Name of storage pool

    stop : boolean
        If ``True``, cancel ongoing scrub

    pause : boolean
        If ``True``, pause ongoing scrub

        .. versionadded:: 2018.3.0

        .. note::

            Pause is only available on recent versions of ZFS.

            If both ``pause`` and ``stop`` are ``True``, then ``stop`` will
            win.

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.scrub myzpool

    '''
    ## select correct action
    if stop:
        action = ['-s']
    elif pause:
        action = ['-p']
    else:
        action = None

    ## Scrub storage pool
    res = __salt__['cmd.run_all'](
        __utils__['zfs.zpool_command'](
            command='scrub',
            flags=action,
            target=zpool,
        ),
        python_shell=False,
    )

    if res['retcode'] != 0:
        return __utils__['zfs.parse_command_result'](res, 'scrubbing')

    ret = OrderedDict()
    if stop or pause:
        ret['scrubbing'] = False
    else:
        ret['scrubbing'] = True
    return ret