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

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddlZddl	Z
ddlmZdZ
eje�Zd�Zd�Zded	�Zd
�ZdS(u8
Management of Block Devices

A state module to manage blockdevices

.. code-block:: yaml


    /dev/sda:
      blockdev.tuned:
        - read-only: True

    master-data:
      blockdev.tuned:
        - name: /dev/vg/master-data
        - read-only: True
        - read-ahead: 1024


.. versionadded:: 2014.7.0
i(tabsolute_importtprint_functiontunicode_literalsN(trangeublockdevcC@s#dtkrtStdjt�fS(uI
    Only load this module if the disk execution module is available
    u	disk.tuneuACannot load the {0} state module: disk execution module not found(t__salt__t__virtualname__tFalsetformat(((s8/usr/lib/python2.7/site-packages/salt/states/blockdev.pyt__virtual__)s	cK@s�iid6dd6|d6td6}idd6dd	6d
d6d
d6}td
sddj|�|d<nqtdr�dj|�|d<d|d<|Std|�}td||�}i}x�|D]�}||kr�||}||||krrt||t�r%||dk}	||dk}
n||}	||}
|dkrV|	}	|
}
ndj|	|
�||<qrq�q�W|r�|r�dj|�|d<||d<q�dj|�|d<ndj|�|d<t|d<|S(u9
    Manage options of block device

    name
        The name of the block device

    opts:
      - read-ahead
          Read-ahead buffer size

      - filesystem-read-ahead
          Filesystem Read-ahead buffer size

      - read-only
          Set Read-Only

      - read-write
          Set Read-Write
    uchangesuucommentunameuresultugetrau
read-aheadugetfraufilesystem-read-aheadugetrou	read-onlyu
read-writeufile.is_blkdevu6Changes to {0} cannot be applied. Not a block device. utestuChanges to {0} will be applied u	disk.dumpu	disk.tuneu1uChanged from {0} to {1}u'Block device {0} successfully modified u)Block device {0} already in correct stateu!Failed to modify block device {0}N(tTrueRRt__opts__tNonet
isinstancetboolR(tnametkwargstrett	kwarg_maptcurrenttchangest	changesettkeytswitchtoldtnew((s8/usr/lib/python2.7/site-packages/salt/states/blockdev.pyttuned3sP











 


uext4cK@s�iid6dj||�d6|d6td6}tjj|�sWdj|�|d<|St|�}||kr}t|d<|Stjjj	dj|��s�dj|�|d<t|d<|St
d	r�d
j|�|d<d|d<|Std||d||�x�t
d
�D]�}tjd|d�t|�}||kr|dj||�|d<i|d6|d6|d<t|d<|S|dkr�tjd�tjd�qPqWdj|�|d<t|d<|S(u�
    Manage filesystems of partitions.

    name
        The name of the block device

    fs_type
        The filesystem it should be formatted as

    force
        Force mke2fs to create a filesystem, even if the specified device is
        not a partition on a block special device. This option is only enabled
        for ext and xfs filesystems

        This option is dangerous, use it with caution.

        .. versionadded:: 2016.11.0
    uchangesu{0} already formatted with {1}ucommentunameuresultu{0} does not existumkfs.{0}uInvalid fs_type: {0}utestuChanges to {0} will be applied udisk.formattforcei
u!Check blk fstype attempt %d of 10iu{0} has been formatted with {1}unewuolduuWaiting 3s before next checkiuFailed to format {0}N(RRtostpathtexistst	_checkblkR	tsalttutilstwhichR
RRRtlogtinfottimetsleep(Rtfs_typeRRRt
current_fsti((s8/usr/lib/python2.7/site-packages/salt/states/blockdev.pyt	formattedxsH








cC@s'tddj|��}|s#dS|S(u=
    Check if the blk exists and return its fstype if ok
    ucmd.runublkid -o value -s TYPE {0}u(RR(Rtblk((s8/usr/lib/python2.7/site-packages/salt/states/blockdev.pyR�s(t__doc__t
__future__RRRRtos.pathR$tloggingtsalt.utils.pathRtsalt.ext.six.movesRRt	getLoggert__name__R"RRRR)R(((s8/usr/lib/python2.7/site-packages/salt/states/blockdev.pyt<module>s	
	EG

Zerion Mini Shell 1.0