%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/zpool.pyc

�
���^c@@s
dZddlmZmZmZddlZddlZddlZddl	Zddl
ZddlmZddl
mZeje�ZdZidd6d	d
6Zd�Zd�Zd
�Zdd�Zdded�Zdded�Zdeed�Zd�Zd�Zed�Z eed�Z!d�Z"d�Z#ed�Z$d�Z%d�Z&ded�Z'ej(j)j*j+d�d��Z,d �Z-ddd!�Z.d"�Z/d#�Z0ed$�Z1dd%�Z2d&�Z3d'�Z4ddd(�Z5deed)�Z6dS(*u�
Module for running ZFS zpool command

:codeauthor:    Nitin Madhok <nmadhok@clemson.edu>, Jorge Schrauwen <sjorge@blackdot.be>
:maintainer:    Jorge Schrauwen <sjorge@blackdot.be>
:maturity:      new
:depends:       salt.utils.zfs
:platform:      illumos,freebsd,linux

.. versionchanged:: 2018.3.1
  Big refactor to remove duplicate code, better type converions and improved
  consistancy in output.

i(tabsolute_importtprint_functiontunicode_literalsN(tzip(tOrderedDictuzpooluimportuimport_ulistulist_cC@s!tjd�rtStdfSdS(u5
    Only load when the platform has zfs support
    uzfs_supportu4The zpool module cannot be loaded: zfs not supportedN(t
__grains__tgett__virtualname__tFalse(((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pyt__virtual__&scC@s't�}x|j�D]	\}}|dkrt|�}|rnt|t�rn|jt||fg��q|r�t|t�r�|||<qt|t�r�|j|�qt|t�rg}x6|j�D](\}}|jt||fg��q�W|j|�|}q|g}qqW|S(uE
    Return a simple vdev tree from zpool.status' config section
    ustateureaduwriteucksum(ustateureaduwriteucksum(Rtitemst_clean_vdev_configt
isinstancetlisttappend(tconfigt
cln_configtlabelt
sub_configt
new_configt	old_labelt
old_config((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pyR0s$	
 
	cC@s7tdtddddg�dt�}|ddkS(	u�
    Check if all zpools are healthy

    .. versionadded:: 2016.3.0

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.healthy

    ucmd.run_alluzfs.zpool_commandustatustflagsu-xtpython_shellustdoutuall pools are healthy(t__salt__t	__utils__R(tres((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pythealthyKs	c
C@sSt�}tdtddd|�dt�}|ddkrMtd|�Sd}d}x�|d	j�D]�}|j�d
kr�qjnd|kr#|jd�dj�}dj|jd�d�j�}|d
kr�||kr�|}t�||<n|d
kr||||<n|}qjdj	||||�|||<qjWx|D]�}d||krlqPnd}	d}
d}d}d}
||d}t�}x�|j�D]�}|	s|j�j
�}	g|	jd�D]}|dkr�|^q�}	q�n|ddkr|d}nttt|	g|j�jd�D]}|dkr?|^q?���}td|�}|j
d�r�|d}
|||
|||
<n�|j
d�r�d}
|d}|||
||<nV|j
d�rd}
}|d}|||
|<n"d}
}}|d}
|||
<|d=q�W|||d<qPW|S(u�
    Return the status of the named zpool

    zpool : string
        optional name of storage pool

    .. versionadded:: 2016.3.0

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.status myzpool

    ucmd.run_alluzfs.zpool_commandustatusttargetRuretcodeiuzfs.parse_command_resultustdoutuu:iupoolu{0}
{1}uconfigu u	uzfs.from_auto_dictiunameiiN(u(uu      u    u  (RRRRtNonet
splitlineststriptsplittjointformattlowerR
Rt
startswith(tzpooltretRtcurrent_pooltcurrent_proptzpdtproptvaluetpooltheadert	root_vdevtvdevtdevtrdevRtconfig_datatlinetxt	stat_data((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pytstatusdsz		"	
	.
	=





ic
C@st�}tdtdddddgd||dg�d	t�}|d
dkrbtd|�Sd
ddddddg}d}d}d}t�}	x{|dj�D]i}
|
j�dks�|
j�j�ddkr�q�n|
jd�r|
j	d�r|j
|	�t�}	q�nttt|g|
j�jd�D]}|d kr?|^q?���}|rtd|�}ntd|�}|
jd!�r�|d
}||	|||<nN|
jd"�r�d}|d
}||	||<nd}}|d
}||	|<|d
=q�W|S(#u
    Display I/O statistics for the given pools

    zpool : string
        optional name of storage pool

    sample_time : int
        seconds to capture data before output
        default a sample of 5 seconds is used
    parsable : boolean
        display data in pythonc values (True, False, Bytes,...)

    .. versionadded:: 2016.3.0
    .. versionchanged:: 2018.3.1

        Added ```parsable``` parameter that defaults to True

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.iostat myzpool

    ucmd.run_alluzfs.zpool_commandtcommanduiostatRu-vRiRuretcodeiuzfs.parse_command_resultunameucapacity-allocu
capacity-freeuoperations-readuoperations-writeu
bandwith-readubandwith-writeustdoutui����uwriteu	bandwidthu-u uzfs.from_auto_dictuzfs.to_auto_dictiN(uwriteu	bandwidth(uu    u  (
RRRRRRRR R$tendswithtupdateR
R(
R%tsample_timetparsableR&RR-R.R/R0tcurrent_dataR3R4tio_data((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pytiostat�sV	
			
		=




usize,alloc,free,cap,frag,healthc
C@st�}t|t�s*|jd�}nxd|krI|jd�q-W|jdd�td�s�x d|kr�|jd�qjWntdtddd	d
dgdidj|�d
6d|�dt	�}|ddkr�td|�Sx�|dj
�D]v}ttt||j�jd����}|rJtd|�}ntd|�}|||d<||dd=qW|S(u 
    .. versionadded:: 2015.5.0

    Return information about (all) storage pools

    zpool : string
        optional name of storage pool

    properties : string
        comma-separated list of properties to list

    parsable : boolean
        display numbers in parsable (exact) values

        .. versionadded:: 2018.3.0

    .. note::

        The ``name`` property will always be included, while the ``frag``
        property will get removed if not available

    zpool : string
        optional zpool

    .. note::

        Multiple storage pool can be provded as a space separated list

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.list
        salt '*' zpool.list zpool=tank
        salt '*' zpool.list 'size,free'
        salt '*' zpool.list 'size,free' tank

    u,unameiuzfs.has_feature_flagsufragucmd.run_alluzfs.zpool_commandR7ulistRu-Htoptsu-oRRuretcodeuzfs.parse_command_resultustdoutu	uzfs.from_auto_dictuzfs.to_auto_dict(
RRR
R tremovetinsertRRR!RRRR(t
propertiesR%R;R&RR3t
zpool_data((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pytlist_\s8'	

				c

C@skt�}ddddg}tdtdddd	d
gd|rG|ndd
|�dt�}|ddkr}td|�Sx�|dj�D]�}ttt|g|j�jd�D]}|dkr�|^q����}	|	d=|rtd|	d|	d�|	d<ntd|	d|	d�|	d<|rQ|	||	d<||	dd=q�|	d||	d<q�W|S(u�
    .. versionadded:: 2016.3.0

    Retrieves the given list of properties

    zpool : string
        Name of storage pool

    prop : string
        Optional name of property to retrieve

    show_source : boolean
        Show source of property

    parsable : boolean
        Display numbers in parsable (exact) values

        .. versionadded:: 2018.3.0

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.get myzpool

    unameupropertyuvalueusourceucmd.run_alluzfs.zpool_commandR7ugetRu-Ht
property_nameuallRRuretcodeiuzfs.parse_command_resultustdoutu	uu
zfs.from_autouzfs.to_auto(u(	RRRRRR
RRR (
R%R*tshow_sourceR;R&tvalue_propertiesRR3R4t	prop_data((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pyR�s0	
				="c
C@sOt�}tdtdddd|d|d|�dt�}td	|d�S(
u]
    Sets the given property on the specified pool

    zpool : string
        Name of storage pool

    prop : string
        Name of property to set

    value : string
        Value to set for the specified property

    .. versionadded:: 2016.3.0

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.set myzpool readonly yes

    ucmd.run_alluzfs.zpool_commandR7usetREtproperty_valueRRuzfs.parse_command_result(RRRR(R%R*R+R&R((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pytsets	
		cC@s=tdtdddd|�dtdt�}|dd	kS(
u�
    Check if a ZFS storage pool is active

    zpool : string
        Name of storage pool

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.exists myzpool

    ucmd.run_alluzfs.zpool_commandR7ulistRRtignore_retcodeuretcodei(RRRtTrue(R%R((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pytexists4s
		cC@sOtdtdddd|r&dgndd|�dt�}td	|d
�S(u�
    Destroys a storage pool

    zpool : string
        Name of storage pool

    force : boolean
        Force destroy of pool

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.destroy myzpool

    ucmd.run_alluzfs.zpool_commandR7udestroyRu-fRRuzfs.parse_command_resultu	destroyedN(RRRR(R%tforceR((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pytdestroyPs
		cC@s�|rdg}n|r$dg}nd}tdtdddd|d|�d	t�}|d
dkrztd|d
�St�}|s�|r�t|d
<n
t|d
<|S(u�
    Scrub a storage pool

    zpool : string
        Name of storage pool

    stop : boolean
        If ``True``, cancel ongoing scrub

    pause : boolean
        If ``True``, pause ongoing scrub

        .. versionadded:: 2018.3.0

        .. note::

            Pause is only available on recent versions of ZFS.

            If both ``pause`` and ``stop`` are ``True``, then ``stop`` will
            win.

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.scrub myzpool

    u-su-pucmd.run_alluzfs.zpool_commandR7uscrubRRRuretcodeiuzfs.parse_command_resultu	scrubbingN(RRRRRRL(R%tstoptpausetactionRR&((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pytscrubns$
			

c
O@s~g}i}g}|jdi�}|jdi�}|jdt�rX|jd�n|jdt�svd|kr�|jd�n|jdt�r�|jd�|d	<n|jd
t�r�|jd
�|d<n|j|�|j|�tdtd
ddd|d|d|d|d|�dt�}td|d�}	|	drzttdd|�|d|�|	d<n|	S(u[
    .. versionadded:: 2015.5.0

    Create a simple zpool, a mirrored zpool, a zpool having nested VDEVs, a hybrid zpool with cache, spare and log drives or a zpool with RAIDZ-1, RAIDZ-2 or RAIDZ-3

    zpool : string
        Name of storage pool

    vdevs : string
        One or move devices

    force : boolean
        Forces use of vdevs, even if they appear in use or specify a
        conflicting replication level.

    mountpoint : string
        Sets the mount point for the root dataset

    altroot : string
        Equivalent to "-o cachefile=none,altroot=root"

    properties : dict
        Additional pool properties

    filesystem_properties : dict
        Additional filesystem properties

    createboot : boolean
        create a boot partition

        .. versionadded:: 2018.3.0

        .. warning:
          This is only available on illumos and Solaris

    CLI Examples:

    .. code-block:: bash

        salt '*' zpool.create myzpool /path/to/vdev1 [...] [force=True|False]
        salt '*' zpool.create myzpool mirror /path/to/vdev1 /path/to/vdev2 [...] [force=True|False]
        salt '*' zpool.create myzpool raidz1 /path/to/vdev1 /path/to/vdev2 raidz2 /path/to/vdev3 /path/to/vdev4 /path/to/vdev5 [...] [force=True|False]
        salt '*' zpool.create myzpool mirror /path/to/vdev1 [...] mirror /path/to/vdev2 /path/to/vdev3 [...] [force=True|False]
        salt '*' zpool.create myhybridzpool mirror /tmp/file1 [...] log mirror /path/to/vdev1 [...] cache /path/to/vdev2 [...] spare /path/to/vdev3 [...] [force=True|False]

    .. note::

        Zpool properties can be specified at the time of creation of the pool
        by passing an additional argument called "properties" and specifying
        the properties with their respective values in the form of a python
        dictionary:

        .. code-block:: text

            properties="{'property1': 'value1', 'property2': 'value2'}"

        Filesystem properties can be specified at the time of creation of the
        pool by passing an additional argument called "filesystem_properties"
        and specifying the properties with their respective values in the form
        of a python dictionary:

        .. code-block:: text

            filesystem_properties="{'property1': 'value1', 'property2': 'value2'}"

        Example:

        .. code-block:: bash

            salt '*' zpool.create myzpool /path/to/vdev1 [...] properties="{'property1': 'value1', 'property2': 'value2'}"

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.create myzpool /path/to/vdev1 [...] [force=True|False]
        salt '*' zpool.create myzpool mirror /path/to/vdev1 /path/to/vdev2 [...] [force=True|False]
        salt '*' zpool.create myzpool raidz1 /path/to/vdev1 /path/to/vdev2 raidz2 /path/to/vdev3 /path/to/vdev4 /path/to/vdev5 [...] [force=True|False]
        salt '*' zpool.create myzpool mirror /path/to/vdev1 [...] mirror /path/to/vdev2 /path/to/vdev3 [...] [force=True|False]
        salt '*' zpool.create myhybridzpool mirror /tmp/file1 [...] log mirror /path/to/vdev1 [...] cache /path/to/vdev2 [...] spare /path/to/vdev3 [...] [force=True|False]

    u
propertiesufilesystem_propertiesuforceu-fu
createbootubootsizeu-Bualtrootu-Ru
mountpointu-mucmd.run_alluzfs.zpool_commandR7ucreateRR?tpool_propertiestfilesystem_propertiesRRuzfs.parse_command_resultucreateduzpool.statusR%uconfiguvdevs(RRRtextendRRR(
R%tvdevstkwargsRR?RRTRURR&((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pytcreate�s:U


		
)cO@s�g}g}|jdt�r.|jd�n|j|�|j|�tdtdddd|d|�d	t�}td
|d�}|dr�ttdd
|�|d|�|d<n|S(uD
    Add the specified vdev's to the given storage pool

    zpool : string
        Name of storage pool

    vdevs : string
        One or more devices

    force : boolean
        Forces use of device

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.add myzpool /path/to/vdev1 /path/to/vdev2 [...]

    uforceu-fucmd.run_alluzfs.zpool_commandR7uaddRRRuzfs.parse_command_resultuaddeduzpool.statusR%uconfiguvdevs(RRRRVRRR(R%RWRXRRRR&((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pytadd*s"


		
)cC@s�g}g}|r"|jd�n|j|�|j|�|j|�tdtdddd|d|�dt�}td	|d
�}|d
r�ttdd|�|d
|�|d<n|S(u�
    Attach specified device to zpool

    zpool : string
        Name of storage pool

    device : string
        Existing device name too

    new_device : string
        New device name (to be attached to ``device``)

    force : boolean
        Forces use of device

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.attach myzpool /path/to/vdev1 /path/to/vdev2 [...]

    u-fucmd.run_alluzfs.zpool_commandR7uattachRRRuzfs.parse_command_resultuattacheduzpool.statusR%uconfiguvdevs(RRRRR(R%tdevicet
new_deviceRNRRRR&((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pytattach_s$



		
)cC@s|tdtdddd||g�dt�}td|d�}|drxttd	d
|�|d|�|d<n|S(
u�
    Detach specified device to zpool

    zpool : string
        Name of storage pool

    device : string
        Device to detach

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.detach myzpool /path/to/vdev1

    ucmd.run_alluzfs.zpool_commandR7udetachRRuzfs.parse_command_resultu	detatcheduzpool.statusR%uconfiguvdevs(RRRR(R%R[RR&((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pytdetach�s
	
)cK@s�i}|jdi�}|jdt�r@|jd�|d<ntdtdddd|d	|d
||g�dt�}td|d�S(
u�
    .. versionadded:: 2018.3.0

    Splits devices off pool creating newpool.

    .. note::

        All vdevs in pool must be mirrors.  At the time of the split,
        ``newzpool`` will be a replica of ``zpool``.

        After splitting, do not forget to import the new pool!

    zpool : string
        Name of storage pool

    newzpool : string
        Name of new storage pool

    mountpoint : string
        Sets the mount point for the root dataset

    altroot : string
        Sets altroot for newzpool

    properties : dict
        Additional pool properties for newzpool

    CLI Examples:

    .. code-block:: bash

        salt '*' zpool.split datamirror databackup
        salt '*' zpool.split datamirror databackup altroot=/backup

    .. note::

        Zpool properties can be specified at the time of creation of the pool
        by passing an additional argument called "properties" and specifying
        the properties with their respective values in the form of a python
        dictionary:

        .. code-block:: text

            properties="{'property1': 'value1', 'property2': 'value2'}"

        Example:

        .. code-block:: bash

            salt '*' zpool.split datamirror databackup properties="{'readonly': 'on'}"

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.split datamirror databackup
        salt '*' zpool.split datamirror databackup altroot=/backup

    u
propertiesualtrootu-Rucmd.run_alluzfs.zpool_commandR7usplitR?RTRRuzfs.parse_command_result(RRRR(R%tnewzpoolRXR?RTR((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pyR �s>
	cC@s�g}g}|r"|jd�n|j|�|j|�|rR|j|�ntdtdddd|d|�dt�}td	|d
�}|d
r�ttdd|�|d
|�|d<n|S(u�
    Replaces ``old_device`` with ``new_device``

    .. note::

        This is equivalent to attaching ``new_device``,
        waiting for it to resilver, and then detaching ``old_device``.

        The size of ``new_device`` must be greater than or equal to the minimum
        size of all the devices in a mirror or raidz configuration.

    zpool : string
        Name of storage pool

    old_device : string
        Old device to replace

    new_device : string
        Optional new device

    force : boolean
        Forces use of new_device, even if its appears to be in use.

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.replace myzpool /path/to/vdev1 /path/to/vdev2

    u-fucmd.run_alluzfs.zpool_commandR7ureplaceRRRuzfs.parse_command_resultureplaceduzpool.statusR%uconfiguvdevs(RRRRR(R%t
old_deviceR\RNRRRR&((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pytreplaces&!


		
)umkfilec	G@st�}t�}tjjjd�}x�|D]�}tjj|�rSd||<q.tddjd|d|d|�dt	�}|d	d
kr�d|kr�d|dkr�d
||<dj
|dj�jd�d�||<q�q.d||<q.W|r||d<n|S(u
    Creates file based virtual devices for a zpool

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.create_file_vdev 7G /path/to/vdev1 [/path/to/vdev2] [...]

    .. note::

        Depending on file size, the above command may take a while to return.

    umkfileuexisteducmd.run_allu{mkfile} {size} {vdev}tmkfiletsizeR/Ruretcodeiustderru:ufailediucreateduerror(
RtsalttutilstpathtwhichtostisfileRR"RR!RR (RcRWR&terrt_mkfile_cmdR/R((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pytcreate_file_vdevSs(		

			
0
cO@szg}g}|jdt�r.|jd�nt|�}tdtdddd|d|�d	t�}td
|d�S(uk
    .. 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]

    uforceu-fucmd.run_alluzfs.zpool_commandR7uexportRRRuzfs.parse_command_resultuexported(RRRR
RR(tpoolsRXRttargetsR((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pytexports
		c	K@s$g}i}g}|jdi�}|jdt�sH|jdt�rX|jd�n|jdt�rz|jd�n|jdt�r�|jd�n|jdt�r�|jd�|d	<n|jd
t�r�|jd
�|d<n|jdt�r|jd�jd
�|d<n|jdt�r�td�r�|jd�}|tdgkrm|jd�n|dkr�|jd�n|dkr�|jd�q�n|r�|j|�|j|�n
|jd�tdtdddd|d|d|d|�dt�}td |d!�S("u?
    .. versionadded:: 2015.5.0

    Import storage pools or list pools available for import

    zpool : string
        Optional name of storage pool

    new_name : string
        Optional new name for the storage pool

    mntopts : string
        Comma-separated list of mount options to use when mounting datasets
        within the pool.

    force : boolean
        Forces import, even if the pool appears to be potentially active.

    altroot : string
        Equivalent to "-o cachefile=none,altroot=root"

    dir : string
        Searches for devices or files in dir, multiple dirs can be specified as
        follows: ``dir="dir1,dir2"``

    no_mount : boolean
        Import the pool without mounting any file systems.

    only_destroyed : boolean
        Imports destroyed pools only. This also sets ``force=True``.

    recovery : bool|str
        false: do not try to recovery broken pools
        true: try to recovery the pool by rolling back the latest transactions
        test: check if a pool can be recovered, but don't import it
        nolog: allow import without log device, recent transactions might be lost

        .. note::
            If feature flags are not support this forced to the default of 'false'

        .. warning::
            When recovery is set to 'test' the result will be have imported set to True if the pool
            can be imported. The pool might also be imported if the pool was not broken to begin with.

    properties : dict
        Additional pool properties

    .. note::

        Zpool properties can be specified at the time of creation of the pool
        by passing an additional argument called "properties" and specifying
        the properties with their respective values in the form of a python
        dictionary:

        .. code-block:: text

            properties="{'property1': 'value1', 'property2': 'value2'}"

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.import [force=True|False]
        salt '*' zpool.import myzpool [mynewzpool] [force=True|False]
        salt '*' zpool.import myzpool dir='/tmp'

    u
propertiesuforceuonly_destroyedu-fu-Duno_mountu-Nualtrootu-Rumntoptsu-oudiru,u-durecoveryuzfs.has_feature_flagsutestu-Fu-nunologu-mu-aucmd.run_alluzfs.zpool_commandR7uimportRR?RTRRuzfs.parse_command_resultuimported(RRRR RRLR(	R%tnew_nameRXRR?RRTtrecoveryR((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pytimport_�sJF$


		cO@s�g}g}|jdt�r.|jd�n|j|�|rQ|j|�ng}g}|jdt�r|jd�n|j|�|j|�tdtdddd|d|�d	t�}td
|d�S(u
    .. versionadded:: 2015.5.0

    Ensure that the specified devices are online

    zpool : string
        name of storage pool

    vdevs : string
        one or more devices

    expand : boolean
        Expand the device to use all available space.

        .. note::

            If the device is part of a mirror or raidz then all devices must be
            expanded before the new space will become available to the pool.

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.online myzpool /path/to/vdev1 [...]

    uexpandu-eucmd.run_alluzfs.zpool_commandR7uonlineRRRuzfs.parse_command_resultuonlined(RRRRVRR(R%RWRXRRR((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pytonline's(



		cO@s�g}g}|jdt�r.|jd�n|j|�|j|�tdtdddd|d|�d	t�}td
|d�S(uG
    .. versionadded:: 2015.5.0

    Ensure that the specified devices are offline

    .. warning::

        By default, the ``OFFLINE`` state is persistent. The device remains
        offline when the system is rebooted. To temporarily take a device
        offline, use ``temporary=True``.

    zpool : string
        name of storage pool

    vdevs : string
        One or more devices

    temporary : boolean
        Enable temporarily offline

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.offline myzpool /path/to/vdev1 [...] [temporary=True|False]

    u	temporaryu-tucmd.run_alluzfs.zpool_commandR7uofflineRRRuzfs.parse_command_resultuofflined(RRRRVRR(R%RWRXRRR((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pytofflinehs


		cC@sOtdtdddd|r&dgndd|�dt�}td	|d
�S(ue
    .. versionadded:: 2018.3.0

    Removes ZFS label information from the specified device

    device : string
        Device name; must not be part of an active pool configuration.

    force : boolean
        Treat exported or foreign devices as inactive

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.labelclear /path/to/dev

    ucmd.run_alluzfs.zpool_commandR7u
labelclearRu-fRRuzfs.parse_command_resultulabelclearedN(RRRR(R[RNR((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pyt
labelclear�s
		cC@sZg}|j|�|j|�tdtdddd|�dt�}td|d�S(	u�
    Clears device errors in a pool.

    .. warning::

        The device must not be part of an active pool configuration.

    zpool : string
        name of storage pool
    device : string
        (optional) specific device to clear

    .. versionadded:: 2018.3.1

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.clear mypool
        salt '*' zpool.clear mypool /path/to/dev

    ucmd.run_alluzfs.zpool_commandR7uclearRRuzfs.parse_command_resultucleared(RRRR(R%R[RR((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pytclear�s


		cC@s:tdtdddd|�dt�}td|d�S(	ub
    Generates a new unique identifier for the pool

    .. warning::
        You must ensure that all devices in this pool are online and healthy
        before performing this action.

    zpool : string
        name of storage pool

    .. versionadded:: 2016.3.0

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.reguid myzpool
    ucmd.run_alluzfs.zpool_commandR7ureguidRRuzfs.parse_command_resultureguided(RRR(R%R((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pytreguid�s
		cC@s:tdtdddd|�dt�}td|d�S(	u�
    Reopen all the vdevs associated with the pool

    zpool : string
        name of storage pool

    .. versionadded:: 2016.3.0

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.reopen myzpool

    ucmd.run_alluzfs.zpool_commandR7ureopenRRuzfs.parse_command_resultureopened(RRR(R%R((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pytreopens
		c
C@s{g}i}|r||d<n|s5|jd�ntdtdddd|d|d	|�d
t�}td|d�S(
u~
    .. versionadded:: 2016.3.0

    Enables all supported features on the given pool

    zpool : string
        Optional storage pool, applies to all otherwize

    version : int
        Version to upgrade to, if unspecified upgrade to the highest possible

    .. warning::
        Once this is done, the pool will no longer be accessible on systems that do not
        support feature flags. See zpool-features(5) for details on compatibility with
        systems that support feature flags, but do not support all features enabled on the pool.

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.upgrade myzpool

    u-Vu-aucmd.run_alluzfs.zpool_commandR7uupgradeRR?RRuzfs.parse_command_resultuupgraded(RRRR(R%tversionRR?R((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pytupgrade$s

		c
C@st�}g}|r%|jd�n|r;|jd�ntdtdddd|d|�d	t�}|d
dkr�td|�Sd
}x{|dj�D]i}|jd�r�|dd!}t�||<q�|dkr�q�n|dd!}|d}	|	|||<q�W|S(u�
    .. versionadded:: 2016.3.0

    Displays the command history of the specified pools, or all pools if no
    pool is specified

    zpool : string
        Optional storage pool

    internal : boolean
        Toggle display of internally logged ZFS events

    verbose : boolean
        Toggle display of the user name, the hostname, and the zone in which
        the operation was performed

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.upgrade myzpool

    u-lu-iucmd.run_alluzfs.zpool_commandR7uhistoryRRRuretcodeiuzfs.parse_command_resultuunknownustdoutuHistory fori
i����uii(RRRRRRR$(
R%tinternaltverboseR&RRR,R3t
log_timestamptlog_command((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pythistoryUs2	
		


(7t__doc__t
__future__RRRRhtloggingtsalt.utils.decoratorsRdtsalt.utils.decorators.pathtsalt.utils.pathtsalt.ext.six.movesRtsalt.utils.odictRt	getLoggert__name__tlogRt__func_alias__R	RRRR6RLR>RDRRRJRMRORSRYRZR]R^R RaRet
decoratorsRfRgRlRoRrRsRtRuRvRwRxRzR(((s6/usr/lib/python2.7/site-packages/salt/modules/zpool.pyt<module>sR
	
		�paQ	&	:	�	59	$	UB!,	-{	A	6 +		1

Zerion Mini Shell 1.0