%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@sndZddlmZmZmZddlZddlZeje	�Z
dZd�Zd�Z
d�ZdS(uf
Managing software RAID with mdadm
==================================

:depends:    mdadm

A state module for creating or destroying software RAID devices.

.. code-block:: yaml

    /dev/md0:
      raid.present:
        - level: 5
        - devices:
          - /dev/xvdd
          - /dev/xvde
          - /dev/xvdf
        - chunk: 256
        - run: True
i(tabsolute_importtprint_functiontunicode_literalsNuraidcC@s1tddkrtStjjjd�s-tStS(u1
    mdadm provides raid functions for Linux
    ukerneluLinuxumdadm(t
__grains__tFalsetsalttutilstpathtwhicht__virtualname__(((s:/usr/lib/python2.7/site-packages/salt/states/mdadm_raid.pyt__virtual__%s
cK@siid6dd6|d6td6}td�}|j|�}g}i}g}	x�|D]�}
|
dks}td|
d	�r�|j|
�qWntd
|
�}d|kr�|d}||kr�g||<n||j|
�qW|	j|
�qWWt|�dkr3d
jt|j���|d<t|d<|St|�dkr�t	|j��d}|r�|d|kr�dj||d�|d<t|d<|S||}
ng}
|r�t}t}nlt|
�dkr�t}t}d}nEt|	�dkrdj|�|d<t|d<|St}t}d}t
drV|r\td||
dt|�}n9|r�td|||	dgt|�dt|�}n|r�dj|�|d<n|s�|r�dj||�|d<d#|d<n|s�|r$t|	�dkr$|dcdj|	�7<d#|d<nt|�dkrR|dcdj|�7<n|S|rstd||
|�n1|r�td|||	dgt|�|�n|std�}|j|�}|r�dj||�|d<||d<td�q0dj||�|d<t|d<ndj|�|d<|s<|r�t|	�dkr�|dr�xl|	D]d}td||�}|s�|dcd j||�7<t|d<q_|dcd!j||�7<q_W|dr�|	|dd"<q�nt|�dkr|dcdj|�7<n|S($uJ
    Verify that the raid is present

    .. versionchanged:: 2014.7.0

    name
        The name of raid device to be created

    level
                The RAID level to use when creating the raid.

    devices
        A list of devices used to build the array.

    kwargs
        Optional arguments to be passed to mdadm.

    Example:

    .. code-block:: yaml

        /dev/md0:
          raid.present:
            - level: 5
            - devices:
              - /dev/xvdd
              - /dev/xvde
              - /dev/xvdf
            - chunk: 256
            - run: True
    uchangesuucommentunameuresultu	raid.listumissingufile.accessufuraid.examineuMD_UUIDiuCDevices are a mix of RAID constituents with multiple MD_UUIDs: {0}.iuuuidu9Devices MD_UUIDs: {0} differs from present RAID uuid {1}.u	assembleduAll devices are missing: {0}.ucreatedutestu
raid.assemblet	test_modeuraid.createuRaid {0} already present.uRaid will be {0} with: {1}u New devices will be added: {0}u Missing devices: {0}u
Raid {0} {1}.uraid.save_configuRaid {0} failed to be {1}.uraid.addu Unable to add {0} to {1}.
u Added new device {0} to {1}.
uaddedN(tTruet__salt__tgettappendtlentformattsortedtkeysRtlistt__opts__tNone(tnametleveltdevicestkwargstrettraidstpresenttmissingt	uuid_dicttnew_devicestdevt
superblocktuuidtdevices_with_superblocktdo_assemblet	do_createtverbtrestchangestd((s:/usr/lib/python2.7/site-packages/salt/states/mdadm_raid.pyR0s�#



 





		












(

 
cC@s�iid6dd6|d6td6}|td�krLdj|�|d<|Stdrwd	j|�|d<d
|d<|Std
|�|d<|dr�dj|�|d<ndj|�|d<|Sd
S(u�
    Verify that the raid is absent

    name
        The name of raid device to be destroyed

    .. code-block:: yaml

        /dev/md0:
          raid:
            - absent
    uchangesuucommentunameuresultu	raid.listuRaid {0} already absentutestuRaid {0} is set to be destroyeduraid.destroyuRaid {0} has been destroyeduRaid {0} failed to be destroyedN(RR
RRR(RR((s:/usr/lib/python2.7/site-packages/salt/states/mdadm_raid.pytabsent�s 




(t__doc__t
__future__RRRtloggingtsalt.utils.pathRt	getLoggert__name__tlogR	R
RR+(((s:/usr/lib/python2.7/site-packages/salt/states/mdadm_raid.pyt<module>s		�

Zerion Mini Shell 1.0