%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/lvm.pyc

�
���^c	@@s�dZddlmZmZmZddlZddlZddlm	Z	d�Z
d�Zd�Zdd�Zd	�Zddddd
eeed�Zdd�ZdS(
u]
Management of Linux logical volumes
===================================

A state module to manage LVMs

.. code-block:: yaml

    /dev/sda:
      lvm.pv_present

    my_vg:
      lvm.vg_present:
        - devices: /dev/sda

    lvroot:
      lvm.lv_present:
        - vgname: my_vg
        - size: 10G
        - stripes: 5
        - stripesize: 8K
i(tabsolute_importtprint_functiontunicode_literalsN(tsixcC@stjjjd�rdStS(u2
    Only load the module if lvm is installed
    ulvm(tsalttutilstpathtwhichtFalse(((s3/usr/lib/python2.7/site-packages/salt/states/lvm.pyt__virtual__"scK@s�iid6dd6|d6td6}td|�rHdj|�|d<n�tdrsd	j|�|d<d|d<|Std
||�}td|�r�dj|�|d<||dd<nd
j|�|d<t|d<|S(u�
    Set a Physical Device to be used as an LVM Physical Volume

    name
        The device name to initialize.

    kwargs
        Any supported options to pvcreate. See
        :mod:`linux_lvm <salt.modules.linux_lvm>` for more details.
    uchangesuucommentunameuresultu
lvm.pvdisplayu#Physical Volume {0} already presentutestu(Physical Volume {0} is set to be createdulvm.pvcreateuCreated Physical Volume {0}ucreatedu$Failed to create Physical Volume {0}N(tTruet__salt__tformatt__opts__tNoneR(tnametkwargstrettchanges((s3/usr/lib/python2.7/site-packages/salt/states/lvm.pyt
pv_present+s"




cC@s�iid6dd6|d6td6}td|�sHdj|�|d<n�tdrsd	j|�|d<d|d<|Std
|�}td|�r�dj|�|d<t|d<n!dj|�|d<||dd
<|S(uq
    Ensure that a Physical Device is not being used by lvm

    name
        The device name to initialize.
    uchangesuucommentunameuresultu
lvm.pvdisplayu"Physical Volume {0} does not existutestu(Physical Volume {0} is set to be removedulvm.pvremoveu$Failed to remove Physical Volume {0}uRemoved Physical Volume {0}uremovedN(R
RRR
RR(RRR((s3/usr/lib/python2.7/site-packages/salt/states/lvm.pyt	pv_absentMs"




cK@s�iid6dd6|d6td6}t|tj�rF|jd�}ntd|�rdj|�|d<x(|D]�}tjj	|�}td	|d
t�}|r�|j
|d�r�||d|kr�dj|dd
j|��|d<q�||ddkr�td||�td	|d
t�}||d|krc|djidj|�|6�q�dj|ddj|��|d<t
|d<q�dj|ddj|||d��|d<t
|d<qpdj|ddj|��|d<t
|d<qpWn�tdr-dj|�|d<d|d<|Std|||�}td|�rwdj|�|d<||dd<ndj|�|d<t
|d<|S(u#
    Create an LVM Volume Group

    name
        The Volume Group name to create

    devices
        A list of devices that will be added to the Volume Group

    kwargs
        Any supported options to vgcreate. See
        :mod:`linux_lvm <salt.modules.linux_lvm>` for more details.
    uchangesuucommentunameuresultu,u
lvm.vgdisplayu Volume Group {0} already presentu
lvm.pvdisplaytrealuVolume Group Nameu{0}
{1}u{0} is part of Volume Groupu
#orphans_lvm2ulvm.vgextenduadded to {0}u{0} could not be addedu{0} is part of {1}upv {0} is not presentutestu%Volume Group {0} is set to be createdulvm.vgcreateuCreated Volume Group {0}ucreatedu!Failed to create Volume Group {0}N(uu
#orphans_lvm2(R
t
isinstanceRtstring_typestsplitRRtosRtrealpathtgetRtupdateRR
(RtdevicesRRtdevicetrealdevtpvsR((s3/usr/lib/python2.7/site-packages/salt/states/lvm.pyt
vg_presentks\








cC@s�iid6dd6|d6td6}td|�sHdj|�|d<n�tdrsd	j|�|d<d|d<|Std
|�}td|�s�dj|�|d<||dd<nd
j|�|d<t|d<|S(uQ
    Remove an LVM volume group

    name
        The volume group to remove
    uchangesuucommentunameuresultu
lvm.vgdisplayuVolume Group {0} already absentutestu%Volume Group {0} is set to be removedulvm.vgremoveuRemoved Volume Group {0}uremovedu!Failed to remove Volume Group {0}N(R
RRR
RR(RRR((s3/usr/lib/python2.7/site-packages/salt/states/lvm.pyt	vg_absent�s"




uc	K@sfiid6dd6|d6td6}
d}|r=|}|}n|redj|jd�d|�}ndj||�}td	|d
t�r�dj|�|
d<n�tdr�d
j|�|
d<d|
d<|
Std||d|d|d|d|d|d|d||	�}
td	|�rBdj|�|
d<|
|
dd<n dj||
�|
d<t|
d<|
S(u�
    Create a new Logical Volume

    name
        The name of the Logical Volume

    vgname
        The name of the Volume Group on which the Logical Volume resides

    size
        The initial size of the Logical Volume

    extents
        The number of logical extents to allocate

    snapshot
        The name of the snapshot

    pv
        The Physical Volume to use

    kwargs
        Any supported options to lvcreate. See
        :mod:`linux_lvm <salt.modules.linux_lvm>` for more details.

    .. versionadded:: to_complete

    thinvolume
        Logical Volume is thinly provisioned

    thinpool
        Logical Volume is a thin pool

    .. versionadded:: 2018.3.0

    force
        Assume yes to all prompts

    uchangesuucommentunameuresultu/dev/{0}/{1}u/iu
lvm.lvdisplaytquietu"Logical Volume {0} already presentutestu'Logical Volume {0} is set to be createdulvm.lvcreatetsizetextentstsnapshottpvt
thinvolumetthinpooltforceuCreated Logical Volume {0}ucreatedu/Failed to create Logical Volume {0}. Error: {1}N(R
RRRRR
R(RtvgnameR$R%R&R'R(R)R*RRt	_snapshottlvpathR((s3/usr/lib/python2.7/site-packages/salt/states/lvm.pyt
lv_present�sB1

	"


	
cC@s�iid6dd6|d6td6}dj||�}td|�sZdj|�|d<n�td	r�d
j|�|d<d|d<|Std||�}td|�s�dj|�|d<||dd
<ndj|�|d<t|d<|S(u�
    Remove a given existing Logical Volume from a named existing volume group

    name
        The Logical Volume to remove

    vgname
        The name of the Volume Group on which the Logical Volume resides
    uchangesuucommentunameuresultu/dev/{0}/{1}u
lvm.lvdisplayu!Logical Volume {0} already absentutestu'Logical Volume {0} is set to be removedulvm.lvremoveuRemoved Logical Volume {0}uremovedu#Failed to remove Logical Volume {0}N(R
RRR
RR(RR+RR-R((s3/usr/lib/python2.7/site-packages/salt/states/lvm.pyt	lv_absent*s$





(t__doc__t
__future__RRRRtsalt.utils.pathRtsalt.extRR	RRRR!R"RR.R/(((s3/usr/lib/python2.7/site-packages/salt/states/lvm.pyt<module>s$			"	E	T

Zerion Mini Shell 1.0