.. versionadded:: 2015.5.0

    Export storage pools

    pools : string
        One or more storage pools to export

    force : boolean
        Force export of storage pools

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.export myzpool ... [force=True|False]
        salt '*' zpool.export myzpool2 myzpool2 ... [force=True|False]

def export(*pools, **kwargs):
    '''
    .. versionadded:: 2015.5.0

    Export storage pools

    pools : string
        One or more storage pools to export

    force : boolean
        Force export of storage pools

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.export myzpool ... [force=True|False]
        salt '*' zpool.export myzpool2 myzpool2 ... [force=True|False]

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

    # NOTE: set extra config based on kwargs
    if kwargs.get('force', False):
        flags.append('-f')

    # NOTE: append the pool name and specifications
    targets = list(pools)

    ## Export pools
    res = __salt__['cmd.run_all'](
        __utils__['zfs.zpool_command'](
            command='export',
            flags=flags,
            target=targets,
        ),
        python_shell=False,
    )

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