%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/ipmi.pyo

�
���^c@@s~dZddlmZmZmZddlmZd�Zdd�Zddd	�Z	d
e
eedd�Zd
d
�Z
dS(u.
Manage IPMI devices over LAN
============================

The following configuration defaults can be defined in the
minion, master config or pillar:

.. code-block:: yaml

    ipmi.config:
        api_host: 127.0.0.1
        api_user: admin
        api_pass: apassword
        api_port: 623
        api_kg: None

Every call can override the config defaults:

.. code-block:: yaml

    ensure myipmi system is set to network boot:
        ipmi.boot_device:
            - name: network
            - api_host: myipmi.hostname.com
            - api_user: root
            - api_pass: apassword
            - api_kg: None

    ensure myipmi system is powered on:
        ipmi.power:
            - name: boot
            - api_host: myipmi.hostname.com
            - api_user: root
            - api_pass: apassword
i(tabsolute_importtprint_functiontunicode_literals(tsixcC@sOd}yddlm}Wn"tk
r>}tj|�}nX|dk|fS(Ni(tcommand(tNonetpyghmi.ipmiRt	ExceptionRt	text_type(t
IMPORT_ERRRtexc((s4/usr/lib/python2.7/site-packages/salt/states/ipmi.pyt__virtual__-sudefaultcK@s�i|d6td6dd6id6}td|�}d|krK|d}n||krot|d<d|d<|Std	r�d
|d<d|d<i|d6|d6|d<|Std
d||�}d|d<t|d<i|d6|d6|d<|S(u�
    Request power state change

    name = ``default``
        * network -- Request network boot
        * hd -- Boot from hard drive
        * safe -- Boot from hard drive, requesting 'safe mode'
        * optical -- boot from CD/DVD/BD drive
        * setup -- Boot into setup utility
        * default -- remove any IPMI directed boot device request

    kwargs
        - api_host=localhost
        - api_user=admin
        - api_pass=
        - api_port=623
        - api_kg=None
    unameuresultuucommentuchangesuipmi.get_bootdevubootdevusystem already in this stateutestuwould change boot deviceuoldunewuipmi.set_bootdevtbootdevuchanged boot deviceN(tFalset__salt__tTruet__opts__R(tnametkwargstrettorgtoutdddd((s4/usr/lib/python2.7/site-packages/salt/states/ipmi.pytboot_device6s$"







upower_oni,cK@si|d6td6dd6id6}td|�}idd6dd6dd	6dd
6dd6dd
6dd6}|||kr�t|d<d|d<|Stdr�dj|�|d<d|d<i|d6|d6|d<|Std|d||�}d|d<t|d<i|d6|d6|d<|S(uW
    Request power state change

    name
        Ensure power state one of:
            * power_on -- system turn on
            * power_off -- system turn off (without waiting for OS)
            * shutdown -- request OS proper shutdown
            * reset -- reset (without waiting for OS)
            * boot -- If system is off, then 'on', else 'reset'

    wait
        wait X seconds for the job to complete before forcing.
        (defaults to 300 seconds)

    kwargs
        - api_host=localhost
        - api_user=admin
        - api_pass=
        - api_port=623
        - api_kg=None
    unameuresultuucommentuchangesuipmi.get_poweruoffuonu	power_offupower_onushutdownunauresetubootusystem already in this stateutestuwould power: {0} systemuoldunewuipmi.set_powertwaituchanged system powerN(R
RRRtformatR(RRRRRt	state_mapR((s4/usr/lib/python2.7/site-packages/salt/states/ipmi.pytpower`s0"






iu
administratorc

K@s�i|d6td6dd6id6}	tdd|d||�}
t}|
d	d
|krat}n|
d	d|kr~t}n|
d	d|kr�t}n|
d	d
|kr�t}ntd|ddd||�tkr�t}n|tkr
t|	d<d|	d<|	StdrDd|	d<d|	d<i|
d6|d6|	d<|	Std|||||||||�tdd|d||�}d|	d<t|	d<i|
d6|d6|	d<|	S(u�
    Ensure IPMI user and user privileges.

    name
        name of user (limit 16 bytes)

    uid
        user id number (1 to 7)

    password
        user password (limit 16 bytes)

    channel
        ipmi channel defaults to 14 for auto

    callback
        User Restricted to Callback

        False = User Privilege Limit is determined by the User Privilege Limit
            parameter privilege_level, for both callback and non-callback connections.

        True  = User Privilege Limit is determined by the privilege_level
            parameter for callback connections, but is restricted to Callback
            level for non-callback connections. Thus, a user can only initiate
            a Callback when they 'call in' to the BMC, but once the callback
            connection has been made, the user could potentially establish a
            session as an Operator.

    link_auth
        User Link authentication
        True/False
        user name and password information will be used for link
        authentication, e.g. PPP CHAP) for the given channel. Link
        authentication itself is a global setting for the channel and is
        enabled/disabled via the serial/modem configuration parameters.

    ipmi_msg
        User IPMI Messaging
        True/False
        user name and password information will be used for IPMI
        Messaging. In this case, 'IPMI Messaging' refers to the ability to
        execute generic IPMI commands that are not associated with a
        particular payload type. For example, if IPMI Messaging is disabled for
        a user, but that user is enabled for activating the SOL
        payload type, then IPMI commands associated with SOL and session
        management, such as Get SOL Configuration Parameters and Close Session
        are available, but generic IPMI commands such as Get SEL Time are
        unavailable.)
        ipmi_msg

    privilege_level
        * callback
        * user
        * operator
        * administrator
        * proprietary
        * no_access

    kwargs
        - api_host=localhost
        - api_user=admin
        - api_pass=
        - api_port=623
        - api_kg=None
    unameuresultuucommentuchangesu
ipmi.get_usertuidtchanneluaccessucallbacku	link_authuipmi_msguprivilege_leveluipmi.set_user_passwordtmodeu
test_passwordtpassworduuser already presentutestuwould (re)create useruoldunewuipmi.ensure_useru(re)created userN(R
RRRR(
RRRRtcallbackt	link_authtipmi_msgtprivilege_levelRRtorg_usertchangetcurrent_user((s4/usr/lib/python2.7/site-packages/salt/states/ipmi.pytuser_present�sJC"					







cK@s�i|d6td6dd6id6}td|||�}t|�dkrbt|d<d|d<|Std	r�d
|d<d|d<i|d6|d<|Sx"|D]}td|||�q�Wd
|d<i|d6dd6|d<|S(uU
    Remove user
    Delete all user (uid) records having the matching name.

    name
        string name of user to delete

    channel
        channel to remove user access from defaults to 14 for auto.

    kwargs
        - api_host=localhost
        - api_user=admin
        - api_pass=
        - api_port=623
        - api_kg=None
    unameuresultuucommentuchangesuipmi.get_name_uidsiuuser already absentutestuwould delete user(s)udeleteuipmi.delete_useruuser(s) removeduolduNoneunewN(R
RtlenRRR(RRRRtuser_id_listR((s4/usr/lib/python2.7/site-packages/salt/states/ipmi.pytuser_absents "






N(t__doc__t
__future__RRRtsalt.extRRRRR
RR&R)(((s4/usr/lib/python2.7/site-packages/salt/states/ipmi.pyt<module>$s		*6m

Zerion Mini Shell 1.0