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

�
���^c@@sudZddlmZmZmZddlZddlZddlm	Z	d�Z
d�Zeeeed�Z
dS(uX
Support for getting and setting the environment variables
of the current salt process.
i(tabsolute_importtprint_functiontunicode_literalsN(tsixcC@stS(uB
    No dependency checks, and not renaming, just return True
    (tTrue(((s7/usr/lib/python2.7/site-packages/salt/states/environ.pyt__virtual__scC@s tjjj�r|j�S|S(u,
    Normalize windows environment keys
    (tsalttutilstplatformt
is_windowstupper(tkey((s7/usr/lib/python2.7/site-packages/salt/states/environ.pyt	_norm_keys
c@s�i|d6id6td6dd6}i}t|tj�sF|tkrS|||<n0t|t�rk|}nt|d<d|d<|S|tkr
gtjD]��|kr��^q�}xP|D]E�|tk	r�|djid�6�q�|djid�6�q�Wnttj�}	g}
x6tj
|�D]%\�}|tkr��fd�}|	jt��d�dkr�|�r�|tk	r|djid�6�qqT|tk	r�|	jt��d�dkr|djid�6�qqT|djid�6�q/|	jt��d�|kr<|
j
��q/|dji|�6�q/Wtdr�|dryd	|d<n
d
|d<|S|dr�td||||��}
|
s�t|d<d|d<|St|d<|
|d<d
|d<n
d|d<|S(uy
    Set the salt process environment variables.

    name
        The environment key to set. Must be a string.

    value
        Either a string or dict. When string, it will be the value
        set for the environment key of 'name' above.
        When a dict, each key/value pair represents an environment
        variable to set.

    false_unsets
        If a key's value is False and false_unsets is True, then the
        key will be removed from the salt processes environment dict
        entirely. If a key's value is False and false_unsets is not
        True, then the key's value will be set to an empty string.
        Default: False

    clear_all
        USE WITH CAUTION! This option can unset environment variables
        needed for salt to function properly.
        If clear_all is True, then any environment variables not
        defined in the environ dict will be deleted.
        Default: False

    update_minion
        If True, apply these environ changes to the main salt-minion
        process. If False, the environ changes will only affect the
        current salt subprocess.
        Default: False

    permanent
        On Windows minions this will set the environment variable in the
        registry so that it is always added as a environment variable when
        applications open. If you want to set the variable to HKLM instead of
        HKCU just pass in "HKLM" for this parameter. On all other minion types
        this will be ignored. Note: This will only take affect on applications
        opened after this has been set.

    Example:

    .. code-block:: yaml

        a_string_env:
           environ.setenv:
             - name: foo
             - value: bar
             - update_minion: True

        a_dict_env:
           environ.setenv:
             - name: does_not_matter
             - value:
                 foo: bar
                 baz: quux
    unameuchangesuresultuucommentu+Environ value must be string, dict or Falsec@sktjjj�rcd}d}�dkr9d}d}ntd||t���}|dtkStSdS(NuHKCUuEnvironmentuHKLMu<SYSTEM\CurrentControlSet\Control\Session Manager\Environmentureg.read_valueusuccess(RRRR	t__salt__RRtFalse(tpermanent_hivet
permanent_keytout(Rt	permanent(s7/usr/lib/python2.7/site-packages/salt/states/environ.pyt
key_exists�s	utestuEnviron values will be changedu6Environ values are already set with the correct valuesuenviron.setenvuFailed to set environ variablesuEnviron values were setu7Environ values were already set with the correct valuesN(Rt
isinstanceRtstring_typesRtdicttostenvirontupdatetNonet	iteritemstgetRtappendt__opts__R
(tnametvaluetfalse_unsetst	clear_allt
update_minionRtretRtto_unsettcurrent_environtalready_settvalRtenviron_ret((RRs7/usr/lib/python2.7/site-packages/salt/states/environ.pytsetenv"sj@


	

(
(





	





(t__doc__t
__future__RRRRtsalt.utils.platformRtsalt.extRRRRR*(((s7/usr/lib/python2.7/site-packages/salt/states/environ.pyt<module>s		

Zerion Mini Shell 1.0