def absent(name, export=False, force=False):
    '''
    ensure storage pool is absent on the system

    name : string
        name of storage pool
    export : boolean
        export instread of destroy the zpool if present
    force : boolean
        force destroy or export

    '''
    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}

    # log configuration
    log.debug('zpool.absent::%s::config::force = %s', name, force)
    log.debug('zpool.absent::%s::config::export = %s', name, export)

    # ensure the pool is absent
    if __salt__['zpool.exists'](name):  # looks like we need to do some work
        mod_res = {}
        ret['result'] = False

        # NOTE: handle test
        if __opts__['test']:
            ret['result'] = True

        # NOTE: try to export the pool
        elif export:
            mod_res = __salt__['zpool.export'](name, force=force)
            ret['result'] = mod_res['exported']

        # NOTE: try to destroy the pool
        else:
            mod_res = __salt__['zpool.destroy'](name, force=force)
            ret['result'] = mod_res['destroyed']

        if ret['result']:  # update the changes and comment
            ret['changes'][name] = 'exported' if export else 'destroyed'
            ret['comment'] = 'storage pool {0} was {1}'.format(name, ret['changes'][name])
        elif 'error' in mod_res:
            ret['comment'] = mod_res['error']

    else:  # we are looking good
        ret['result'] = True
        ret['comment'] = 'storage pool {0} is absent'.format(name)

    return ret
def absent ( name , export = False , force = False ) : ret = { 'name' : name , 'changes' : { } , 'result' : None , 'comment' : '' } log . debug ( 'zpool.absent::%s::config::force = %s' , name , force ) log . debug ( 'zpool.absent::%s::config::export = %s' , name , export ) if __salt__ [ 'zpool.exists' ] ( name ) : mod_res = { } ret [ 'result' ] = False if __opts__ [ 'test' ] : ret [ 'result' ] = True elif export : mod_res = __salt__ [ 'zpool.export' ] ( name , force = force ) ret [ 'result' ] = mod_res [ 'exported' ] else : mod_res = __salt__ [ 'zpool.destroy' ] ( name , force = force ) ret [ 'result' ] = mod_res [ 'destroyed' ] if ret [ 'result' ] : ret [ 'changes' ] [ name ] = 'exported' if export else 'destroyed' ret [ 'comment' ] = 'storage pool {0} was {1}' . format ( name , ret [ 'changes' ] [ name ] ) elif 'error' in mod_res : ret [ 'comment' ] = mod_res [ 'error' ] else : ret [ 'result' ] = True ret [ 'comment' ] = 'storage pool {0} is absent' . format ( name ) return ret
ensure storage pool is absent on the system

    name : string
        name of storage pool
    export : boolean
        export instread of destroy the zpool if present
    force : boolean
        force destroy or export