HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/__pycache__/__init__.cpython-310.pyc
o

�N�g��@s|dZddlZddlZddlZddlZddlZddlZddlZddlZ	ddl
Z	ddlZ	ddlZ	ddl
Z	ddlZ	ddlZ	ddlZ	ddlZ	ddlZ	ddlZ	ddlZ	ddlZ	ddlZ	ddlmZddlmZddlmZddlmZmZm Z e�!e"�Z#dZ$ge%ed	��e%ed
��e%ed��e%edd
d��e%edd��e%ed��e%ed��e%ed��e%ed��e%ed��e%ed��e%ed��e%ed��e%ed��e%ed��e%ed��e%ed��e%ed��e%ed��e%ed��e%ed ��e%ed!��e%ed"��e%ed#��e%ed$d%��e%ed$d&��e%ed'��e%ed(��e%ed)��e%ed*��e%ed+��e%ed,��RZ&			-				dhd.d/�Z'			-			-did0d1�Z(				2		2			djd3d4�Z)dkd5d6�Z*dld7d�Z+dld8d�Z,dmd9d�Z-						:	dnd;d�Z.	dod<d�Z/						dpd=d+�Z0dmd>d?�Z1dld@d*�Z2dqdAdB�Z3dldCdD�Z4dldEd#�Z5dldFdG�Z6dmdHd	�Z7dldId�Z8dodJd �Z9dldKd(�Z:					drdLd'�Z;dqdMd
�Z<dldNd�Z=	dodOdP�Z>					drdQdR�Z?dqdSdT�Z@dUdV�ZAdWdX�ZBdsdYd�ZCdZd[�ZDdod\d]�ZEdld^d�ZFdod_d"�ZGdld`d%�ZHdldad&�ZIdldbd�ZJdldcd�ZKdoddd�ZLdlded�ZMejNdfdg��ZOdS)tz�
The Salt loader is the core to Salt's plugin system, the loader scans
directories for python loadable code and organizes the code into the
plugin interfaces used by Salt.
�N)�LoaderError)�check_render_pipe_str)�entrypoints�)�SALT_BASE_PATH�FilterDictWrapper�
LazyLoader)zparallels.avail_sizeszparallels.avail_locationszproxmox.avail_sizes�auth�beacons�cache�client�ssh�wrapper�cloud�clouds�engines�	executors�
fileserver�grains�log_handlers�matchers�	metaproxy�modules�netapi�output�pillar�proxy�queues�	renderers�	returners�roster�runners�sdb�serializers�spm�pkgdb�pkgfiles�states�thorium�tokens�tops�utils�wheelTc

	CsVtt|||||||�||||	d�}
i}|
��|rt|
|�}
|
D]}|
|||<q |S)N��tag�pack�loaded_base_name)r�_module_dirsZ	_load_allr)
�opts�ext_typer.r/�int_type�ext_dirs�
ext_type_dirs�	base_pathZfilter_namer0�funcs�ret�key�r;�H/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/__init__.py�
static_loaderTs,�	�
r=c
CsZ|dur|}tj�|ptt�|p|�g}|�d�r$tj�|d|�g}	ng}	|d�t�s7td�	|dt
���g}
|�rQ|durE|�d�}||vrP|
�||�|�rQ|du�rQt�
d�D]�}t|��}|��}
Wd�n1srwY|jr{q]t�}t|
tj�r�t|��}|
�}Wd�n1s�wY|jr�q]t|t�r�||vr�q]t|��}t||t�r�td��||D]}|�|�q�Wd�n1s�wYni|j|kr�q]|D]}|�|�q�nXt|
tj��r)|
jD]7}t|��}tj�||�}tj�|��s
	Wd�q�Wd�n	1�swY|j�r"q�|�|�q�nt|��td�	|
���1�s9wY|D]}tj�|��rN|
�|��q@q]g}|�d	g�D]0}tj�||�}tj�|��rq|�d|��qYtj�|d
|���}tj�|��r�|�d|��qY|�di��dd
��r�tj j!�"dd�||
|	|S||	|
|S)NZextension_modulesrz�{!r} is not considered a salt internal loader path. If this is a new loader being added, please also add it to {}.SALT_INTERNAL_LOADERS_PATHS.Z_dirsTzsalt.loaderzRThe callable must return an iterable of strings. A single string is not supported.z/Don't know how to load a salt extension from {}�module_dirs�_ZfeaturesZ-enable_deprecated_module_search_path_priorityFi�z�The old module search path priority will be removed in Salt 3008. For more information see https://github.com/saltstack/salt/pull/65938.)#�os�path�join�strr�get�
startswith�SALT_INTERNAL_LOADERS_PATHS�RuntimeError�format�__name__�extendrZiter_entry_points�catch_entry_points_exception�load�exception_caught�set�
isinstance�types�FunctionType�dict�
ValueError�add�name�
ModuleType�__path__�exists�append�isdir�insert�saltr+ZversionsZ
warn_until)r2r3r.r4r5r6r7�load_extensionsZ	sys_typesZ	ext_typesZext_type_types�entry_point�ctxZloaded_entry_pointZloaded_entry_point_pathsZloaded_entry_point_valuerAZloaded_entry_point_pathZ!entry_point_ext_type_package_pathZcli_module_dirsZ_dirZ	maybe_dirr;r;r<r1xs�

�


�
�

����
�

����
���
�����r1Fc
Cs@|s|�dd�}tt|dd�|d|||||	d�||||r|jnddd�	}
|r0t|t�r0|
|jd<|�dd	�}|rqt|t�rq|D]1}z
t||||
�}
Wn
tyUYnw|
rp|
D]}d
�	|||�
d�d��}|
||
|<qZq?|r�ddl}|jj
jd
|d	d��}|jddi|jjjd�Wd�|
S1s�wY|
S)a�
    Load execution modules

    Returns a dictionary of execution modules appropriate for the current
    system by evaluating the __virtual__() function in each module.

    :param dict opts: The Salt options dictionary

    :param dict context: A Salt context that should be made present inside
                            generated modules in __context__

    :param dict utils: Utility functions which should be made available to
                            Salt modules in __utils__. See `utils_dirs` in
                            salt.config for additional information about
                            configuration.

    :param list whitelist: A list of modules which should be whitelisted.
    :param bool initial_load: Deprecated flag! Unused.
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    :param bool notify: Flag indicating that an event should be fired upon
                        completion of module loading.


    Example:

    .. code-block:: python

        import salt.config
        import salt.loader

        __opts__ = salt.config.minion_config('/etc/salt/minion')
        __grains__ = salt.loader.grains(__opts__)
        __opts__['grains'] = __grains__
        __utils__ = salt.loader.utils(__opts__)
        __salt__ = salt.loader.minion_mods(__opts__, utils=__utils__)
        __salt__['test.ping']()
    Zwhitelist_modulesNr�module)�__context__�	__utils__�	__proxy__Z__opts__�__file_client__�__salt__)r.r/�	whitelistr0�static_modules�extra_module_dirs�	pack_self�	providersFz{}{}�.rZminion)r2�listenZcompleteT)r.)rDrr1r>rOr/rR�raw_mod�	TypeErrorrH�rindexZsalt.utils.eventr+�eventZ	get_eventZ
fire_event�defaults�eventsZMINION_MOD_REFRESH_COMPLETE)r2�contextr+rfZinitial_loadr0�notifyrgr�file_clientr9rj�modr8�funcZf_keyr\Zevtr;r;r<�minion_mods
sV3
��
���
��rxcsPtt||d�|ddd|i|d��|�jvriS��|�t�fdd��jD��S)a�
    Returns a single module loaded raw and bypassing the __virtual__ function

    :param dict opts: The Salt options dictionary
    :param str name: The name of the module to load
    :param LazyLoader functions: A LazyLoader instance returned from ``minion_mods``.
    :param str mod: The extension type.
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.

    Example:

    .. code-block:: python

        import salt.config
        import salt.loader

        __opts__ = salt.config.minion_config('/etc/salt/minion')
        testmod = salt.loader.raw_mod(__opts__, 'test', None)
        testmod['test.ping']()
    r`Z	rawmoduleFre)r.�virtual_enabler/r0csi|]}|�|�qSr;r;)�.0�x��loaderr;r<�
<dictcomp>�szraw_mod.<locals>.<dictcomp>)rr1Zfile_mappingZ_load_modulerR�_dict)r2rU�	functionsrvr0r;r|r<rmrs
�
	
rmcC�tt|d�|d|d�S)z�
    Return functions used in the meta proxy

    :param dict opts: The Salt options dictionary
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    r�r.r0�rr1�r2r0r;r;r<r���cCr�)z�
    Return the matcher services plugins

    :param dict opts: The Salt options dictionary
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    rr�r�r�r;r;r<r�r�cCs8||||d�}tt|d�|d||r|j|d�Sd|d�S)a!
    Return the engines plugins

    :param dict opts: The Salt options dictionary
    :param LazyLoader functions: A LazyLoader instance returned from ``minion_mods``.
    :param LazyLoader runners: A LazyLoader instance returned from ``runner``.
    :param LazyLoader utils: A LazyLoader instance returned from ``utils``.
    :param LazyLoader proxy: An optional LazyLoader instance returned from ``proxy``.
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    )reZ__runners__rcrbrN�r.r/rhr0�rr1r>)r2r�r!r+rr0r/r;r;r<r�s 
���rcc	Cs0tt|d�|d||||d�|r|jnd||d�S)aq
    Returns the proxy module for this salt-proxy-minion

    :param dict opts: The Salt options dictionary
    :param LazyLoader functions: A LazyLoader instance returned from ``minion_mods``.
    :param LazyLoader returners: A LazyLoader instance returned from ``returners``.
    :param LazyLoader utils: A LazyLoader instance returned from ``utils``.
    :param dict context: A Salt context that should be made present inside
                            generated modules in __context__
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    r)reZ__ret__rbraN�r.r/rhrir0r�)r2r�rrfr+rsrir0r;r;r<r�s��c	Cs(tt|dd�|d||||pid�|d�S)aZ
    Returns the returner modules

    :param dict opts: The Salt options dictionary
    :param LazyLoader functions: A LazyLoader instance returned from ``minion_mods``.
    :param dict context: A Salt context that should be made present inside
                            generated modules in __context__
    :param list whitelist: A list of modules which should be whitelisted.
    :param LazyLoader proxy: An optional LazyLoader instance returned from ``proxy``.
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    rZreturner�rerarc�r.rfr/r0r�)r2r�rfrsrr0r;r;r<r�s
�c
Cs0tt|dddd�|d|||pi|d�||dd�S)a
    Returns the utility modules

    :param dict opts: The Salt options dictionary
    :param list whitelist: A list of modules which should be whitelisted.
    :param dict context: A Salt context that should be made present inside
                            generated modules in __context__
    :param LazyLoader proxy: An optional LazyLoader instance returned from ``proxy``.
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    r+Z
utils_dirsF)r6r])rarcrd)r.rfr/rir0Z(_only_pack_properly_namespaced_functionsr�)r2rfrsrrurir0r;r;r<r+s��c	Cs8t|�}tt|d�|d|||d�|jd|d�}t|d�S)a�
    Returns the pillars modules

    :param dict opts: The Salt options dictionary
    :param LazyLoader functions: A LazyLoader instance returned from ``minion_mods``.
    :param dict context: A Salt context that should be made present inside
                            generated modules in __context__
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    r)rerarbZ__ext_pillar__r�z.ext_pillar)r+rr1r>r)r2r�rsr0�_utilsr9r;r;r<�pillars9s
�
	r�cCs@d|vriSt|d���}tt|dd�|d||d�}t|d�S)z�
    Returns the tops modules

    :param dict opts: The Salt options dictionary
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    Zmaster_topsr*�top)r.rfr0z.top)�list�keysrr1r)r2r0rfr9r;r;r<r*Qs
�
cCs*|duri}tt|d�|d|d|i|d�S)a�
    Returns the wheels modules

    :param dict opts: The Salt options dictionary
    :param list whitelist: A list of modules which should be whitelisted.
    :param dict context: A Salt context that should be made present inside
                            generated modules in __context__
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    Nr,rar�r�)r2rfrsr0r;r;r<�wheelsfs�r�cCs2tt|ddd�|d|d�}t|d�}||jd<|S)a.
    Returns the outputters modules

    :param dict opts: The Salt options dictionary
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    :returns: LazyLoader instance, with only outputters present in the keyspace
    rZoutputter_dirs�r6r�z.outputre)rr1rr/)r2r0r9Zwrapped_retr;r;r<�
outputters}s	�

r�cCr�)a/
    Returns the serializers modules
    :param dict opts: The Salt options dictionary
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    :returns: LazyLoader instance, with only serializers present in the keyspace
    r#r�r�r�r;r;r<r#�r�cCr�)a-
    Returns the tokens modules
    :param dict opts: The Salt options dictionary
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    :returns: LazyLoader instance, with only token backends present in the keyspace
    r)r�r�r�r;r;r<�eauth_tokens�r�r�cCs"tt|d�|d|dt|�i|d�S)a�
    Returns the auth modules

    :param dict opts: The Salt options dictionary

    :param LazyLoader functions: A LazyLoader instance returned from ``minion_mods``.
    :param list whitelist: A list of modules which should be whitelisted.
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    :returns: LazyLoader
    r	rer�)rr1rx)r2rfr0r;r;r<r	�s
�c	Cs�t|�}|dur@t|t�s|g}t�}t�d�}|D]!}|�|�}|r6|�|�d��|�|�d�d�q|�|�qt|�}t	t
|d�|d|d|i|j|d�S)a
    Returns the file server modules

    :param dict opts: The Salt options dictionary
    :param list backends: List of backends to load.
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    Nz^(git|svn|hg)(?:fs)?$r�fsrrb�r.rfr/rhr0)r+rOr�rN�re�compile�matchrT�grouprr1r>)r2Zbackendsr0r�Zbackend_setZvcs_reZbackendr�r;r;r<r�s,	


�c	Cs2tt|d�|d|||d�|r|j|d�Sd|d�S)a�
    Returns the roster modules

    :param dict opts: The Salt options dictionary
    :param LazyLoader runner: A LazyLoader instance returned from ``runner``.
    :param LazyLoader utils: A LazyLoader instance returned from ``utils``.
    :param list whitelist: A list of modules which should be whitelisted.
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    r )�
__runner__rbNr�r�)r2�runnerr+rfr0r;r;r<r �s��cCs2||id�}tt|d�|d||d�}||jd<|S)a�
    Load the thorium runtime modules

    :param dict opts: The Salt options dictionary
    :param LazyLoader functions: A LazyLoader instance returned from ``minion_mods``.
    :param LazyLoader runners: A LazyLoader instance returned from ``runner``.
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    )rer�rar(r-Z__thorium__)rr1r/)r2r�r!r0r/r9r;r;r<r(s
�
c		CsF|duri}tt|d�|d||pi||||d�||r|jndd|d�S)a&
    Returns the state modules

    :param dict opts: The Salt options dictionary
    :param LazyLoader functions: A LazyLoader instance returned from ``minion_mods``.
    :param LazyLoader runners: A LazyLoader instance returned from ``runner``.
    :param LazyLoader utils: A LazyLoader instance returned from ``utils``.
    :param LazyLoader serializers: An optional LazyLoader instance returned from ``serializers``.
    :param LazyLoader proxy: An optional LazyLoader instance returned from ``proxy``.
    :param list whitelist: A list of modules which should be whitelisted.
    :param dict context: A Salt context that should be made present inside
                            generated modules in __context__
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.

    .. code-block:: python

        import salt.config
        import salt.loader

        __opts__ = salt.config.minion_config('/etc/salt/minion')
        statemods = salt.loader.states(__opts__, None, None)
    Nr')rercrbZ__serializers__rard�
__states__�r.r/rfrhrir0r�)	r2r�r+r#rfrrsr0rur;r;r<r's$"��cCs&tt|d�|d|||pid�g|d�S)a
    Load the beacon modules

    :param dict opts: The Salt options dictionary
    :param LazyLoader functions: A LazyLoader instance returned from ``minion_mods``.
    :param dict context: A Salt context that should be made present inside
                            generated modules in __context__
    :param LazyLoader proxy: An optional LazyLoader instance returned from ``proxy``.
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    r
)rarerc)r.r/Z
virtual_funcsr0r��r2r�rsrr0r;r;r<r
Ss�cCs tt|d�|d|d�}t|d�S)z�
    Returns the custom logging handler modules

    :param dict opts: The Salt options dictionary
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    rr�z.setup_handlers)rr1r)r2r0r9r;r;r<ris��
	cCs0tt|dttdd�d�|d|||d�|d�S)a�
    Returns the custom logging handler modules

    :param LazyLoader functions: A LazyLoader instance returned from ``minion_mods``.
    :param dict context: A Salt context that should be made present inside
                            generated modules in __context__
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    rrr
�r7)rerardr-�rr1rCr)r2r�rsrur0r;r;r<�ssh_wrapper}s���r�cCs�|duri}||�di�||d�}|r||d<|duri}||d<tt|dddd	�|d||d
�}t|d�}	t|d|	|d
|d�sRd�|d�}
t�|
�t|
��|	S)a\
    Returns the render modules

    :param dict opts: The Salt options dictionary
    :param LazyLoader functions: A LazyLoader instance returned from ``minion_mods``.
    :param LazyLoader states: A LazyLoader instance returned from ``states``.
    :param dict context: A Salt context that should be made present inside
                            generated modules in __context__
    :param LazyLoader proxy: An optional LazyLoader instance returned from ``proxy``.
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    Nr)reZ
__grains__rardr�rcr�renderZrender_dirsr�r-z.renderZrendererZrenderer_blacklistZrenderer_whitelistz^The renderer {} is unavailable, this error is often because the needed software is unavailable)	rDrr1rrrH�log�criticalr)r2r�r'rrsrur0r/r9Zrend�errr;r;r<r��sD
���
�
�
r�cCsNt||d�}t||d�|d�}tt|dddd�|d|j||d�}||jd<|S)	a�
    Returns the grain functions

    :param dict opts: The Salt options dictionary
    :param dict context: A Salt context that should be made present inside
                            generated modules in __context__
    :param LazyLoader proxy: An optional LazyLoader instance returned from ``proxy``.
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.

      .. code-block:: python

          import salt.config
          import salt.loader

          __opts__ = salt.config.minion_config('/etc/salt/minion')
          grainfuncs = salt.loader.grain_funcs(__opts__)
    )r�rbrarZgrainZgrains_dirsr�)r.rhr/r0rb)r+rr1r>r/)r2rrsr0r�r/r9r;r;r<�grain_funcs�s"��

r�cCs,|�d�r|d}t|t�rt|�|d<|S)z>
    Returns cached grains with fixed types, like tuples.
    �osrelease_info)rDrOr��tuple)�
cached_grainsr�r;r;r<�_format_cached_grainss


r�cCs�tj�|�s
t�d�dStt��tj�|��}||�dd�kr.t�d||�dd��dS|�dd�r;t�d�dSt�d	�z4t	j
j�|d
��}t	j
j
jt	j�|�dd�}Wd�n1sawY|spt�d
�WdSt|�WSty~YdSw)z`
    Returns the grains cached in cfn, or None if the cache is too old or is
    corrupted.
    z!Grains cache file does not exist.NZgrains_cache_expirationi,znGrains cache last modified %s seconds ago and cache expiration is set to %s. Grains cache expired. Refreshing.Zrefresh_grains_cacheFz+refresh_grains_cache requested, Refreshing.zRetrieving grains from cache�rbT�Zpreserve_tuplesz>Cached grains are empty, cache might be corrupted. Refreshing.)r@rA�isfiler��debug�int�time�getmtimerDr\r+�files�fopen�data�decode�payloadrLr��OSError)r2�cfnZgrains_cache_age�fp_r�r;r;r<�_load_cached_grainss8

�

��

�r�cCsZddl}tj�|dd�}|s|�dd�rt||�}|r|Snt�d�|�dd�r,iS|�d	d�d
u}d|vr�i}	|	�|j	�
|dd|j	jd��|	�d
|d
�}
|	�dg�}|	�|j	j|
|ddd��|	�|j	j||dd
d��d|	vr�|	d|d<n	i|d<ni|d<i}|�dg�}
t
|||p�i|d�}|r�|��|D]K}|�d�s�q�t�d|�||�}t|t�s�q�|
r�t|�D]}|
D]}|jj�||�r�||=t�d|�q�q�|s�q�|r�|jj�||�q�|�|�q�|D]�}|�d�s�|dkr�q�z-t�d|�t�||�j}i}d|v�r||d<d|v�r ||d<||d'i|��}Wn!t�yK|jj���r>t�d�tjd|||d
d�Yq�wt|t��sSq�|
�rzt|�D]}|
D]}|jj�||��rr||=t�d|��q^�qZ|�szq�|�r�|jj�||�q�|�|�q�|�dd
��r�|�r�zR|j dd}|d|v�r�|d|v�r�||d��r�z!|j dd}||d�}|�r�|jj�||�n|�|�Wnt�y�tjdd
d�YnwWn
t!�y�Ynw|�|d�|�dd��r�|jj"�#d ��~zO|jj�$��r ddl%}|j&j'�(d!|�d"��|jj"�)|d#��&}z	|j*�+||�Wnt,�yF}zt�-d$|��d}~wwWd�n	1�sRwYWn&t�y~}zt�-d%||�tj�.|��rtt�/|�WYd}~nd}~wwWd�n	1�s�wY|�r�|jj�||d�n|�|d�|jj0j1|d
d&�S)(a6
    Return the functions for the dynamic grains and the values for the static
    grains.

    :param dict opts: The Salt options dictionary
    :param bool force_refresh: Force the refresh of grains
    :param dict context: A Salt context that should be made present inside
                            generated modules in __context__
    :param LazyLoader proxy: An optional LazyLoader instance returned from ``proxy``.
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.

    Since grains are computed early in the startup process, grains functions
    do not have __salt__ or __proxy__ available.  At proxy-minion startup,
    this function is called with the proxymodule LazyLoader object so grains
    functions can communicate with their controlled device.

    .. code-block:: python

        import salt.config
        import salt.loader

        __opts__ = salt.config.minion_config('/etc/salt/minion')
        __grains__ = salt.loader.grains(__opts__)
        print __grains__['id']
    rNZcachedirzgrains.cache.pZgrains_cacheFz,Grains refresh requested. Refreshing grains.Zskip_grains�grains_deep_mergeTZ	conf_fileZSALT_MINION_CONFIG�default_include�include)�verboserZgrains_blacklist)rrsr0zcore.zLoading %s grainzFiltering %s grain�_errorsrzdThe following CRITICAL message may not be an error; the proxy may not be completely established yet.zFFailed to load grains defined in grain file %s in function %s, error:
)�exc_infoZproxy_merge_grains_in_module�	proxytypez.grainsz.initializedz&Failed to run proxy's grains function!�?zattrib -R "�"zw+bz$Failed to serialize grains cache: %sz+Unable to write to grains cache file %s: %sr�r;)2�salt.configr@rArBrDr�r�r��updateZconfigZload_configZDEFAULT_MINION_OPTSZinclude_configr��clearrE�tracerOrRr�r+ZstringutilsZ
expr_matchZ
dictupdate�inspectZ	signature�
parameters�	Exception�platformZis_proxy�infor�r2�KeyErrorr�Z	set_umaskZ
is_windowsZsalt.modules.cmdmodrZcmdmodZ
_run_quietr�r��dumprn�errorr��unlinkr�r�)r2Z
force_refreshrrsr0r\r�r�r�Zpre_optsr�r�Zgrains_dataZblistr8r:r9�blockr��kwargsr�r��er;r;r<r2s4
�

��
���
�


��

���
���
�
���������
����cKsP|�dg�}|�dg�}|�dd�}tttd�g|ddd|d�}|||�S)z<
    Directly call a function inside a loader directory
    �args�dirsr0NrF)r.ryr0)rD�poprrCr)Zfunr�r�r�r0r8r;r;r<�call�s�r�c
CsL|duri}|duri}tt|dddd�|d||d�||r |jndd|d�S)	a
    Directly call a function inside a loader directory

    :param dict opts: The Salt options dictionary
    :param list whitelist: A list of modules which should be whitelisted.
    :param dict context: A Salt context that should be made present inside
                            generated modules in __context__
    :param LazyLoader utils: A LazyLoader instance returned from ``utils``.
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    Nr!r�Zrunner_dirsr�r�rer�r�)r2r+rsrfr0r;r;r<r�s�r�cCstt|dddd�|d|d�S)z�
    Directly call a function inside a loader directory

    :param dict opts: The Salt options dictionary
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    r�queueZ
queue_dirsr�r�r�r�r;r;r<r(s�c
CsH|duri}tt|d�|d||t||d�d�||r|j|d�Sd|d�S)a�
    Make a very small database call

    :param dict opts: The Salt options dictionary
    :param LazyLoader functions: A LazyLoader instance returned from ``minion_mods``.
    :param list whitelist: A list of modules which should be whitelisted.
    :param LazyLoader utils: A LazyLoader instance returned from ``utils``.
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    Nr")r+)Z__sdb__rbre)r.r/rfrhr0)rr1rxr>)r2r�rfr+r0r;r;r<r"8s"
��
�cC�"tt|dttd�d�|d|d�S)a	
    Return modules for SPM's package database

    .. versionadded:: 2015.8.0

    :param dict opts: The Salt options dictionary
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    r%r$r�r�r�r�r;r;r<r%Us
�cCr�)a
    Return modules for SPM's file handling

    .. versionadded:: 2015.8.0


    :param dict opts: The Salt options dictionary
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    r&r$r�r�r�r�r;r;r<r&gs�cCs`t|�}tt|ddttd�dd�|d|dd�|j|d�}tD]}t�d|�|�	|d�q|S)z�
    Return the cloud functions

    :param dict opts: The Salt options dictionary
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    rr)r7r4N)rbZ__active_provider_name__r�zZ'%s' has been marked as not supported. Removing from the list of supported cloud functions)
r+rr1rCrr>�LIBCLOUD_FUNCS_NOT_SUPPORTEDr�r�r�)r2r0r�r��funcnamer;r;r<rzs,
���cCr�)z�
    Return the network api functions

    :param dict opts: The Salt options dictionary
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    rr�r�r�r;r;r<r�r�cCs<|duri}|duri}tt|dd�|d|||d�d|d�S)a
    Returns the executor modules

    :param dict opts: The Salt options dictionary
    :param LazyLoader functions: A LazyLoader instance returned from ``minion_mods``.
    :param dict context: A Salt context that should be made present inside
                            generated modules in __context__
    :param LazyLoader proxy: An optional LazyLoader instance returned from ``proxy``.
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    Nr�executorr�Z
__executors__)r.r/rir0r�r�r;r;r<r�s

�cCstt|dd�|d|d�S)z�
    Returns the returner modules

    :param dict opts: The Salt options dictionary
    :param str loaded_base_name: The imported modules namespace when imported
                                 by the salt loader.
    rr�r�r�r;r;r<r�s
�c
csl�tjdd�}z|VWdSty5}zd|_t�|�}tjd|j|j	|t
jd�WYd}~dSd}~ww)NF)rMTz3Error processing Salt Extension %s(version: %s): %s)Zexc_info_on_loglevel)rP�SimpleNamespacer�rMrZ!name_and_version_from_entry_pointr�r�rU�version�logging�DEBUG)r^rs�excZentry_point_detailsr;r;r<rK�s �
���rK)NNTNNNN)NNTNNT)	NNNFNFNNN)rN)N)NN)NNNNNrcN)NNNN)NNNNNN)NNN)NNNNN)FNNN)P�__doc__�
contextlibr�r�r@r�r�rPr�r\Zsalt.defaults.eventsZsalt.defaults.exitcodesZsalt.loader.contextZ
salt.syspathsZsalt.utils.contextZsalt.utils.dataZsalt.utils.dictupdateZsalt.utils.filesZsalt.utils.lazyZsalt.utils.odictZsalt.utils.platformZsalt.utils.stringutilsZsalt.utils.versionsZsalt.exceptionsrZ
salt.templaterZ
salt.utilsrZlazyrrr�	getLoggerrIr�r�rCrFr=r1rxrmrrrrrr+r�r*r�r�r#r�r	rr r(r'r
rr�r�r�r�r�rr�r�rr"r%r&rrrr�contextmanagerrKr;r;r;r<�<module>sn

�
�
���
�
�
�
	�

�
�
�

�
�
�
�
�
�
�
�
�
�
�
���
�
�
�
�
�
 �(
�'
�
�
h
(


�'
�
�
$







'

�
8

� 
�
@&
'H






$