#NEWLINE# def destroy( zpool , force = False ) : #NEWLINE# #INDENT# "\n    .. versionchanged:: 2016.3.0\n\n    Destroys a storage pool\n\n    zpool : string\n        name of storage pool\n    force : boolean\n        force destroy of pool\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' zpool.destroy myzpool\n    " #NEWLINE# ret = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# ret [ zpool ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( not exists ( zpool ) ) : #NEWLINE# #INDENT# ret [ res ] = 'storage pool does not exist' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# zpool_cmd = _check_zpool ( ) #NEWLINE# cmd = '{zpool_cmd} destroy {force}{zpool}' . format ( zpool_cmd = zpool_cmd , force = ( '-f ' if force else '' ) , zpool = zpool ) #NEWLINE# res = __salt__ [ 'cmd.run_all' ] ( cmd , python_shell = False ) #NEWLINE# if ( res [ 'retcode' ] != 0 ) : #NEWLINE# #INDENT# ret [ zpool ] = 'error destroying storage pool' #NEWLINE# if ( ( 'stderr' in res ) and ( res [ 'stderr' ] != '' ) ) : #NEWLINE# #INDENT# ret [ zpool ] = res [ 'stderr' ] #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# ret [ zpool ] = 'destroyed' #NEWLINE# #UNINDENT# #UNINDENT# return ret