%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/states/drac.pyo

�
���^c@@sbdZddlmZmZmZddlZddlZd�Zd�Z	d�Z
d�ZdS(ug
Management of Dell DRAC

The DRAC module is used to create and manage DRAC cards on Dell servers


Ensure the user damian is present

  .. code-block:: yaml

    damian:
      drac.present:
        - name: damian
        - password: secret
        - permission: login,test_alerts,clear_logs


Ensure the user damian does not exist

  .. code-block:: yaml

    damian:
      drac.absent:
        - name: damian


Ensure DRAC network is in a consistent state

  .. code-block:: yaml

    my_network:
      drac.network:
        - ip: 10.225.108.29
        - netmask: 255.255.255.224
        - gateway: 10.225.108.1

i(tabsolute_importtprint_functiontunicode_literalsNcC@stjjjd�rtStS(u0
    Ensure the racadm command is installed
    uracadm(tsalttutilstpathtwhichtTruetFalse(((s4/usr/lib/python2.7/site-packages/salt/states/drac.pyt__virtual__-scC@s�i|d6td6id6dd6}td�}tdr�||kr[dj|�|d<n$d	j|�|d<id
|6|d<|S||kr�dj|�|d<nTtd||||�r�dj|�|d<id
|6|d<nd|d<t|d<|S(u�
    Ensure the user exists on the Dell DRAC

    name:
        The users username

    password
        The password used to authenticate

    permission
        The permissions that should be assigned to a user
    unameuresultuchangesuucommentudrac.list_usersutestu`{0}` already existsu`{0}` will be createduwill be createdudrac.create_useru`{0}` user createdunew user createduUnable to create user(Rt__salt__t__opts__tformatR(tnametpasswordt
permissiontrettusers((s4/usr/lib/python2.7/site-packages/salt/states/drac.pytpresent7s&





cC@s�i|d6td6id6dd6}td�}tdr�||krldj|�|d<id	|6|d<nd
j|�|d<|S||kr�td|||d�r�d
j|�|d<id|6|d<q�d|d<t|d<nd
j|�|d<|S(u]
    Ensure a user does not exist on the Dell DRAC

    name:
        The users username
    unameuresultuchangesuucommentudrac.list_usersutestu`{0}` is set to be deleteduwill be deletedu`{0}` does not existudrac.delete_useruindexu
`{0}` deletedudeleteduUnable to delete user(RR
RRR(R
RR((s4/usr/lib/python2.7/site-packages/salt/states/drac.pytabsentas&





cC@sei|d6td6id6dd6}td�}i}||ddkrz|djii|ddd	6|d
6d6�n||ddkr�|djii|ddd	6|d
6d6�n||dd
kr|djii|dd
d	6|d
6d
6�ntdrd|d<|Std|||�rM|dsId|d<n|St|d<d|d<|S(u9
    Ensure the DRAC network settings are consistent
    unameuresultuchangesuucommentudrac.network_infou
IPv4 settingsu
IP AddressuOlduNewuSubnet MaskuNetmaskuGatewayutestudrac.set_networkuNetwork is in the desired stateuunable to configure networkN(RR
tupdateRtNoneR(tiptnetmasktgatewayRtcurrent_networktnew_network((s4/usr/lib/python2.7/site-packages/salt/states/drac.pytnetwork�s8











(t__doc__t
__future__RRRtsalt.exceptionsRtsalt.utils.pathR	RRR(((s4/usr/lib/python2.7/site-packages/salt/states/drac.pyt<module>&s	
	*	$

Zerion Mini Shell 1.0