HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/jinja.cpython-310.pyc
o

�N�g�
�@sndZddlZddlZddlZddlZddlZddlZe�e	�Z
dd�Zedd��Zedd��Z
ed	d
��ZdS)zl
Module for checking jinja maps and verifying the result of loading JSON/YAML
files

.. versionadded:: 3000
�Ncst����fdd��}|S)zQ
    dump to json and load it again, replaces OrderedDicts with regular ones
    cstjj�tjj��|���S)N)�salt�utils�json�loads�dumps)�args��wrapped��F/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/jinja.py�stripsz_strip_odict.<locals>.strip)�	functools�wraps)r	rr
rr�_strip_odictsrcCs>t�dj||d��}tj�|tj�tt	�tdtdtd�S)a�
    Loads the map at the specified path, and returns the specified value from
    that map.

    CLI Example:

    .. code-block:: bash

        # Assuming the map is loaded in your formula SLS as follows:
        #
        # {% from "myformula/map.jinja" import myformula with context %}
        #
        # the following syntax can be used to load the map and check the
        # results:
        salt myminion jinja.load_map myformula/map.jinja myformula
    ze        {{% from "{path}" import {value} with context %}}
        {{{{ {value} | tojson }}}}
        )�path�value�renderer�renderer_blacklist�renderer_whitelist�
�textwrap�dedent�formatr�templateZcompile_template_str�loaderZrenderZ__opts__Z__salt__)rr�tmplstrr
r
r�load_maps���rcC�<t�dj|d��}tj�|tj�tt	�tdtdtd�S)z�
    Loads YAML data from the specified path

    CLI Example:

    .. code-block:: bash

        salt myminion jinja.import_yaml myformula/foo.yaml
    z]        {{% import_yaml "{path}" as imported %}}
        {{{{ imported | tojson }}}}
        �rrrrr�rrr
r
r�import_yamlB����r cCr)z�
    Loads JSON data from the specified path

    CLI Example:

    .. code-block:: bash

        salt myminion jinja.import_json myformula/foo.json
    z]        {{% import_json "{path}" as imported %}}
        {{{{ imported | tojson }}}}
        rrrrrrr
r
r�import_json^r!r")�__doc__r
�loggingrZsalt.loaderrZ
salt.templateZsalt.utils.json�	getLogger�__name__�logrrr r"r
r
r
r�<module>s

"