#NEWLINE# def detach( zpool , device ) : #NEWLINE# #INDENT# "\n    .. versionchanged:: 2016.3.0\n\n    Detach specified device to zpool\n\n    zpool : string\n        name of storage pool\n    device : string\n        device to detach\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' zpool.detach myzpool /path/to/vdev1\n    " #NEWLINE# ret = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# dlist = [ ] #NEWLINE# if ( not exists ( zpool ) ) : #NEWLINE# #INDENT# ret [ zpool ] = 'storage pool does not exist' #NEWLINE# return ret #NEWLINE# #UNINDENT# zpool_cmd = _check_zpool ( ) #NEWLINE# cmd = '{zpool_cmd} detach {zpool} {device}' . format ( zpool_cmd = zpool_cmd , zpool = zpool , device = device ) #NEWLINE# res = __salt__ [ 'cmd.run_all' ] ( cmd , python_shell = False ) #NEWLINE# if ( res [ 'retcode' ] != 0 ) : #NEWLINE# #INDENT# ret [ zpool ] = ( res [ 'stderr' ] if ( 'stderr' in zpool ) else res [ 'stdout' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ret [ zpool ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# ret [ zpool ] [ device ] = 'detached' #NEWLINE# #UNINDENT# return ret