def offline(zpool, *vdevs, **kwargs):
 ret = {}
 if (not exists(zpool)):
  ret[zpool] = 'storage pool does not exist'
  return ret
 if ((not vdevs) or (len(vdevs) <= 0)):
  ret[zpool] = 'no devices specified'
  return ret
 ret[zpool] = {}
 devs = ' '.join(vdevs)
 zpool_cmd = _check_zpool()
 cmd = '{zpool_cmd} offline {temp}{zpool} {devs}'.format(zpool_cmd=zpool_cmd, temp=('-t ' if kwargs.get('temporary', False) else ''), zpool=zpool, devs=devs)
 res = __salt__['cmd.run_all'](cmd, python_shell=False)
 if (res['retcode'] != 0):
  ret[zpool] = (res['stderr'] if ('stderr' in res) else res['stdout'])
 else:
  ret[zpool] = 'offlined {0}'.format(devs)
 return ret

def offline ( zpool , * vdevs , ** kwargs ) : ret = { } if ( not exists ( zpool ) ) : ret [ zpool ] = 'storage pool does not exist' return ret if ( ( not vdevs ) or ( len ( vdevs ) <= 0 ) ) : ret [ zpool ] = 'no devices specified' return ret ret [ zpool ] = { } devs = ' ' . join ( vdevs ) zpool_cmd = _check_zpool ( ) cmd = '{zpool_cmd} offline {temp}{zpool} {devs}' . format ( zpool_cmd = zpool_cmd , temp = ( '-t ' if kwargs . get ( 'temporary' , False ) else '' ) , zpool = zpool , devs = devs ) res = __salt__ [ 'cmd.run_all' ] ( cmd , python_shell = False ) if ( res [ 'retcode' ] != 0 ) : ret [ zpool ] = ( res [ 'stderr' ] if ( 'stderr' in res ) else res [ 'stdout' ] ) else : ret [ zpool ] = 'offlined {0}' . format ( devs ) return ret
mark a cache storage device as offline .