%PDF- %PDF-
Direktori : /usr/lib/python2.7/site-packages/salt/utils/ |
Current File : //usr/lib/python2.7/site-packages/salt/utils/environment.pyc |
� ���^c @@ sA d Z d d l m Z m Z m Z d d l Z d d d � Z d S( u Environment utilities. i ( t absolute_importt print_functiont unicode_literalsNc C@ sw i } | s i } n x[| j d i � | j d i � g D]5} | j d d � } t j j | � j d � d } t j j t j j | � � } | j d � g } | | k r� | j | � n x� | D]� } | s� q� n | j | j d i � j | i � j | i � j d i � j � � | d k r� | j | j d i � j | i � j | i � j | i � j � � q� q� Wq: W| S( ug Get module optional environment. To setup an environment option for a particular module, add either pillar or config at the minion as follows: system-environment: modules: pkg: _: LC_ALL: en_GB.UTF-8 FOO: bar install: HELLO: world states: pkg: _: LC_ALL: en_US.Latin-1 NAME: Fred So this will export the environment to all the modules, states, returnes etc. And calling this function with the globals() in that context will fetch the environment for further reuse. Underscore '_' exports environment for all functions within the module. If you want to specifially export environment only for one function, specify it as in the example above "install". First will be fetched configuration, where virtual name goes first, then the physical name of the module overrides the virtual settings. Then pillar settings will override the configuration in the same order. :param env: :param function: name of a particular function :return: dict u __opts__u __pillar__u __file__u u .i u __virtualname__u system-environmentu _N( t gett ost patht basenamet splitt dirnamet appendt updatet copyt None( t envt functiont resultt env_srct fnamet physical_namet sectiont m_namest m_name( ( s: /usr/lib/python2.7/site-packages/salt/utils/environment.pyt get_module_environment s&