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__/context.cpython-310.pyc
o

�N�g1�@s�dZddlZddlZddlZzddlZWn
ey!ddlZYnwddlZ	dZ
e�e
�Zej
dd��ZGdd�dejj�ZGdd	�d	�ZdS)
z5
Manage the context a module loaded by Salt's loader
�N�
loader_ctxvarc	cs0�t�|�}zdVWt�|�dSt�|�w)zD
    A context manager that sets and un-sets the loader context
    N)r�set�reset)�loader�tok�r�G/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py�loader_contexts
�
r	c@s�eZdZdZd)dd�Zdd�Zdd�Zd	d
�Zdd�Zd)d
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�ZdS)*�NamedLoaderContextz�
    A NamedLoaderContext object is injected by the loader providing access to
    Salt's 'magic dunders' (__salt__, __utils__, etc).
    NcCs||_||_||_dS�N��namer	�default)�selfr
r	rrrr�__init__)s
zNamedLoaderContext.__init__cCst|j|j|d�S)N)r)r
r
r	)rrrrr�with_default.szNamedLoaderContext.with_defaultcCs"z|j��WStyYdSw)zz
        The LazyLoader in the current context. This will return None if there
        is no context established.
        N)r	r�AttributeError�rrrrr1s
�zNamedLoaderContext.loadercCs6|��durdS|��}|jdur|j}|jdus|Sr)rZ
parent_loader�rrrrr�
eldest_loader;s

�z NamedLoaderContext.eldest_loadercCs�|��}|dur|jS|j|jkr|S|jdkr|j|jS|jdkr)|j|jSz|j|jWStyAtj�d|j����w)z;
        The value of the current for this context
        N�__context__Z__opts__z-LazyLoader does not have a packed value for: )	rrr
Z	pack_self�pack�KeyError�salt�
exceptionsZLoaderErrorrrrr�valueCs 


��zNamedLoaderContext.valuecCs|���||�Sr)r�get)r�keyrrrrrW�zNamedLoaderContext.getcCs|��|Sr�r�r�itemrrr�__getitem__Z�zNamedLoaderContext.__getitem__cCs||��vSrrr rrr�__contains__]r#zNamedLoaderContext.__contains__cCs||��|<dSrr)rr!rrrr�__setitem__`rzNamedLoaderContext.__setitem__cCst|���Sr)�boolrrrrr�__bool__cr#zNamedLoaderContext.__bool__cC�|����Sr)r�__len__rrrrr)fr#zNamedLoaderContext.__len__cCr(r)r�__iter__rrrrr*ir#zNamedLoaderContext.__iter__cC�|���|�Sr)r�__delitem__r rrrr,l�zNamedLoaderContext.__delitem__cCs(t||j�sdS|j|jko|j|jkS�NF)�
isinstance�	__class__r	r
�r�otherrrr�__eq__oszNamedLoaderContext.__eq__cCs|j|jdd�S)Nr)r
r	rrrr�__getstate__ts�zNamedLoaderContext.__getstate__cCs"|d|_|d|_|d|_dS)Nr
r	rr�r�staterrr�__setstate__{s

zNamedLoaderContext.__setstate__cCst|��|�Sr)�getattrr�rr
rrr�__getattr__�r-zNamedLoaderContext.__getattr__cCst�|j�}|�|j|j|�Sr)�copy�deepcopyrr0r
r	)r�memorrrr�__deepcopy__�szNamedLoaderContext.__deepcopy__cCr+r)r�missing_fun_stringr9rrrr?�r-z%NamedLoaderContext.missing_fun_stringr)�__name__�
__module__�__qualname__�__doc__rrrrrrr"r$r%r'r)r*r,r3r4r7r:r>r?rrrrr
#s*


r
c@sReZdZdZefdd�Zdd�Zdd�Zdefd	d
�Z	dd�Z
d
d�Zdd�ZdS)�
LoaderContextz�
    A loader context object, this object is injected at <loaded
    module>.__salt_loader__ by the Salt loader. It is responsible for providing
    access to the current context's loader
    cCs
||_dSr)r)rrrrrr��
zLoaderContext.__init__cCs
|j|Sr)rr rrrr"�rEzLoaderContext.__getitem__cCs$z|j��WStytd��w)zp
        Return the LazyLoader in the current context. If there is no value set raise an AttributeError
        zNo loader context)rr�LookupErrorrrrrrr�s
�zLoaderContext.loaderNcCs||||�S)zX
        Return a NamedLoaderContext instance which will use this LoaderContext
        r)rr
rZ	ctx_classrrr�
named_context�szLoaderContext.named_contextcCst||j�sdS|j|jkSr.)r/r0rr1rrrr3�szLoaderContext.__eq__cCsd|jjiS�NZvarname)rr
rrrrr4�r#zLoaderContext.__getstate__cCst�|d�|_dSrH)�contextvars�
ContextVarrr5rrrr7�szLoaderContext.__setstate__)
r@rArBrCrrr"rr
rGr3r4r7rrrrrD�s	rD)rC�collections.abc�collections�
contextlibr;Z_contextvarsrI�ImportErrorZsalt.exceptionsrZDEFAULT_CTX_VARrJr�contextmanagerr	�abc�MutableMappingr
rDrrrr�<module>s �

h