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

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddl	m
Z
eje�Z
dZd�Zd�Zejjjed�Zd	�Zd
�Zdddeed�Zddeeed
�Zddeeeed�ZdS(ub
Management of Windows system information
========================================

.. versionadded:: 2014.1.0

This state is used to manage system information such as the computer name and
description.

.. code-block:: yaml

    ERIK-WORKSTATION:
      system.computer_name: []

    This is Erik's computer, don't touch!:
      system.computer_desc: []
i(tabsolute_importtunicode_literalstprint_functionN(tsixusystemcC@s&tjjj�r"dtkr"tStS(u$
    This only supports Windows
    usystem.get_computer_desc(tsalttutilstplatformt
is_windowst__salt__t__virtualname__tFalse(((s:/usr/lib/python2.7/site-packages/salt/states/win_system.pyt__virtual__&scC@s�tj|�}i|d6id6td6dj|�d6}td�}||krW|Stdr�d|d<dj|�|d<|Std	|�}|d
|kr�dj|�|d<i|d6|d
6|d<nt|d<dj|�|d<|S(ud
    Manage the computer's description field

    name
        The desired computer description
    unameuchangesuresultu)Computer description already set to '{0}'ucommentusystem.get_computer_descutestu-Computer description will be changed to '{0}'usystem.set_computer_descuComputer Descriptionu2Computer description successfully changed to '{0}'uoldunewu+Unable to set computer description to '{0}'N(Rt	text_typetTruetformatRt__opts__tNoneR
(tnametrettbefore_desctresult((s:/usr/lib/python2.7/site-packages/salt/states/win_system.pyt
computer_desc/s,







ucomputer_descriptioncC@s�tj|�}i|d6id6td6dj|�d6}td�}td�}||krp|dkrp|S||j�kr�dj||�|d<|Std	r�d|d<d
j|�|d<|Std|�}|tk	r�|dd
}|dj	d�}|dk	r||ks4|dkri||kridj|�|d<|dk	ri|dcd7<qini|d6|d6|d<nt|d<dj|�|d<|S(uP
    Manage the computer's name

    name
        The desired computer name
    unameuchangesuresultu"Computer name already set to '{0}'ucommentusystem.get_computer_nameu system.get_pending_computer_nameuSThe current computer name is '{0}', but will be changed to '{1}' on the next rebootutestu&Computer name will be changed to '{0}'usystem.set_computer_nameu
Computer NameuCurrentuPendingu'Computer name successfully set to '{0}'u, (reboot required for change to take effect)uoldunewu$Unable to set computer name to '{0}'N(
RRR
RRRtupperRR
tget(RRtbefore_nametpending_nameRt
after_namet
after_pending((s:/usr/lib/python2.7/site-packages/salt/states/win_system.pyt
computer_nameXs<





cC@s�i|d6id6td6dd6}td�}|j�|j�kr^dj|�|d<|Std|�}|r�d	j||�|d<i|d
6|d<nt|d<d|d<|S(us
    .. versionadded:: 2016.3.0

    Manage the hostname of the computer

    name
        The hostname to set
    unameuchangesuresultuucommentusystem.get_hostnameu Hostname is already set to '{0}'usystem.set_hostnameuNThe current hostname is '{0}', but will be changed to '{1}' on the next rebootuhostnameuUnable to set hostname(R
RRRR
(RRtcurrent_hostnametout((s:/usr/lib/python2.7/site-packages/salt/states/win_system.pythostname�s"	



c

C@s{i|d6id6td6dj|�d6}td�}d|krQ|d}nd|krfd}nd}|j�|j�kr�dj|�|d<|Std	r�d|d<d
j|�|d<|Stdd|d
|d|d|d|d|�}	|	tk	rZdj|�|d<|r/|dcd7<n|dcd7<i|d6|d6|d<ndj|�|d<t|d<|S(u�
    Checks if a computer is joined to the Domain. If the computer is not in the
    Domain, it will be joined.

    Args:

        name (str):
            The name of the Domain.

        username (str):
            Username of an account which is authorized to join computers to the
            specified domain. Need to be either fully qualified like
            user@domain.tld or simply user.

        password (str):
            Password of the account to add the computer to the Domain.

        account_ou (str):
            The DN of the OU below which the account for this computer should be
            created when joining the domain,
            e.g. ou=computers,ou=departm_432,dc=my-company,dc=com.

        account_exists (bool):
            Needs to be set to ``True`` to allow re-using an existing computer
            account.

        restart (bool):
            Needs to be set to ``True`` to restart the computer after a
            successful join.

    Example:

    .. code-block:: yaml

        join_to_domain:
          system.join_domain:
            - name: mydomain.local.com
            - username: myaccount@mydomain.local.com
            - password: mysecretpassword
            - restart: True
    unameuchangesuresultuComputer already added to '{0}'ucommentusystem.get_domain_workgroupuDomainu	WorkgrouputestuComputer will be added to '{0}'usystem.join_domaintdomaintusernametpasswordt
account_outaccount_existstrestartuComputer added to '{0}'u
System will restartu
System needs to be restarteduoldunewuComputer failed to join '{0}'N(R
RRRtlowerRR
(
RR!R"R#R$R%Rtcurrent_domain_dictcurrent_domainR((s:/usr/lib/python2.7/site-packages/salt/states/win_system.pytjoin_domain�sB0


	

	

icC@s.t|d|d|d|dtd|d|�S(u�
    Reboot the computer

    :param str message:
        An optional message to display to users. It will also be used as a
        comment in the event log entry.

        The default value is None.

    :param int timeout:
        The number of minutes or seconds before a reboot will occur. Whether
        this number represents minutes or seconds depends on the value of
        ``in_seconds``.

        The default value is 5.

    :param bool in_seconds:
        If this is True, the value of ``timeout`` will be treated as a number
        of seconds. If this is False, the value of ``timeout`` will be treated
        as a number of minutes.

        The default value is False.

    :param bool force_close:
        If this is True, running applications will be forced to close without
        warning. If this is False, running applications will not get the
        opportunity to prompt users about unsaved data.

        The default value is True.

    :param bool only_on_pending_reboot:

        If this is True, the reboot will only occur if the system reports a
        pending reboot. If this is False, the reboot will always occur.

        The default value is True.
    tmessagettimeouttforce_closetreboott
in_secondstonly_on_pending_reboot(tshutdownR
(RR*R+R,R.R/((s:/usr/lib/python2.7/site-packages/salt/states/win_system.pyR-s(c	C@s:i|d6id6td6dd6}|r1d}nd}|r�td�r�td	rkd
j|�|d<ndj|�|d<|Std	r�d|d<dj|�|d<|Std
d|d|d|d|d|dt�|d<|dr#idd6dj|�d6|d<dj|�|d<ndj|�|d<|S(u�
    Shutdown the computer

    :param str message:
        An optional message to display to users. It will also be used as a
        comment in the event log entry.

        The default value is None.

    :param int timeout:
        The number of minutes or seconds before a shutdown will occur. Whether
        this number represents minutes or seconds depends on the value of
        ``in_seconds``.

        The default value is 5.

    :param bool in_seconds:
        If this is True, the value of ``timeout`` will be treated as a number
        of seconds. If this is False, the value of ``timeout`` will be treated
        as a number of minutes.

        The default value is False.

    :param bool force_close:
        If this is True, running applications will be forced to close without
        warning. If this is False, running applications will not get the
        opportunity to prompt users about unsaved data.

        The default value is True.

    :param bool reboot:

        If this is True, the computer will restart immediately after shutting
        down. If False the system flushes all caches to disk and safely powers
        down the system.

        The default value is False.

    :param bool only_on_pending_reboot:

        If this is True, the shutdown will only occur if the system reports a
        pending reboot. If this is False, the shutdown will always occur.

        The default value is False.
    unameuchangesuresultuucommenturebootushutdownusystem.get_pending_rebootutestu7System {0} will be skipped because no reboot is pendingu9System {0} has been skipped because no reboot was pendinguWill attempt to schedule a {0}usystem.shutdownR*R+R,R-R.R/u#No reboot or shutdown was scheduleduolduA {0} has been scheduledunewuRequest to {0} was successfuluRequest to {0} failedN(R
RRRRR
(	RR*R+R,R-R.R/Rtaction((s:/usr/lib/python2.7/site-packages/salt/states/win_system.pyR02s<0

	






(t__doc__t
__future__RRRtloggingtsalt.utils.functoolsRtsalt.utils.platformtsalt.extRt	getLoggert__name__tlogR	RRRt	functoolstalias_functiontcomputer_descriptionRRRR
R)R
R-R0(((s:/usr/lib/python2.7/site-packages/salt/states/win_system.pyt<module>s*			&	/	$U-

Zerion Mini Shell 1.0