%PDF- %PDF-
| Direktori : /proc/self/root/proc/thread-self/root/usr/lib/python2.7/site-packages/salt/states/ |
| Current File : //proc/self/root/proc/thread-self/root/usr/lib/python2.7/site-packages/salt/states/environ.pyo |
�
���^c @@ su d Z d d l m Z m Z m Z d d l Z d d l Z d d l m Z d � Z
d � Z e e e e d � Z
d S( uX
Support for getting and setting the environment variables
of the current salt process.
i ( t absolute_importt print_functiont unicode_literalsN( t sixc C@ s t S( uB
No dependency checks, and not renaming, just return True
( t True( ( ( s7 /usr/lib/python2.7/site-packages/salt/states/environ.pyt __virtual__ s c C@ s t j j j � r | j � S| S( u,
Normalize windows environment keys
( t saltt utilst platformt
is_windowst upper( t key( ( s7 /usr/lib/python2.7/site-packages/salt/states/environ.pyt _norm_key s
c @ s� i | d 6i d 6t d 6d d 6} i } t | t j � sF | t k rS | | | <n0 t | t � rk | } n t | d <d | d <| S| t k r
g t j D] � � | k r� � ^ q� } xP | D]E � | t k r� | d j i d � 6� q� | d j i d � 6� q� Wn t t j � } g }
x6t j
| � D]%\ � } | t k r� � f d � } | j t � � d � d k r�| � r�| t k r| d j i d � 6� qqT| t k r�| j t � � d � d k r| d j i d � 6� qqT| d j i d � 6� q/| j t � � d � | k r<|
j
� � q/| d j i | � 6� q/Wt d r�| d ryd | d <n
d
| d <| S| d r�t d | | | | � � }
|
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
u nameu changesu resultu u commentu+ Environ value must be string, dict or Falsec @ sk t j j j � rc d } d } � d k r9 d } d } n t d | | t � � � } | d t k St Sd S( Nu HKCUu Environmentu HKLMu<