File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/jinja.cpython-310.pyc
o
;j�� � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddl Z ddl
Z
ddlmZ ddl
mZmZmZ ddlmZ ddlmZ ddlmZmZmZ ddlZddlmZmZmZ dd lmZ dd
lm Z ddl!m"Z" ddl#Z$ddl%Z$ddl&Z$ddl'Z$ddl(Z$ddl)Z$ddl*Z$ddl+m,Z, dd
l-m.Z.m/Z/m0Z0 ddl1m2Z2 zddl3m4Z4 W n e5y� ddlm4Z4 Y nw e�6e7�Z8ddgZ9e �:d�Z;e2ej<�Z=G dd� de�Z>dd� Z?G dd� de�Z@e/d�dd� �ZAe0d�d^dd��ZBe0d�d d!� �ZCe.d"�d#d$� �ZDe.d%�d&d'� �ZEe.d(�d)d(� �ZFe.d*�d_d,d*��ZGe.d-�d.d-� �ZHe.� d/d0� �ZIe.d1�d^d2d1��ZJe.d3�d^d4d3��ZKe.d5�d^d6d5��ZLe.d7�d8d9� �ZMe.� d:d;� �ZNe.d<�d=d>� �ZOe.d?�d@dA� �ZPe.dB�dCdD� �ZQe.dE�dFdE� �ZRe.dG�dHdG� �ZSe.dI�dJdI� �ZTe.dK�dLdK� �ZUe.dM�dNdM� �ZVzejWZWW n
eX�y� ejYZWY nw eWdOdP� �ZZdQdR� Z[dSdT� Z\dUdV� Z]dWdX� Z^dYdZ� Z_e.d[�e^d`d\d[���Z`G d]d� de"�ZadS )azK
Jinja loading utils to enable a more powerful backend for jinja templates
� N)�OrderedDict)�Hashable�Mapping�Sequence��wraps)�minidom)�Element�
SubElement�tostring)�
BaseLoader�TemplateNotFound�nodes)�TemplateModule)�TemplateRuntimeError)� Extension��
TemplateError)�jinja_filter�jinja_global�
jinja_test)�Version)�Markup�SaltCacheLoader�SerializerExtensionz$91633EBF-1C86-5E33-935A-28061F4B480Ec @ sZ e Zd ZdZ ddd�Zdd � Zd
d� Zdd
� Zdd� Zdd� Z dd� Z
dd� ZdS )r z�
A special jinja Template Loader for salt.
Requested templates are always fetched from the server
to guarantee that the file is up to date.
Templates are cached like regular salt states
and only loaded once per loader instance.
�base�utf-8FNc C s� || _ || _|| _|| _| jr"|| j d vrg | _n|d | | _ntj�|d d|�g| _t� d| j� g | _
|| _|d u | _d S )NZpillar_rootsZcachedir�fileszJinja search path: %s)
�opts�saltenv�encoding�pillar_rend�
searchpath�os�path�join�log�debug�cached�_file_client�_close_file_client)�selfr r r r! r) � r, �D/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/jinja.py�__init__<