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/renderers/__pycache__/yaml.cpython-310.pyc
o

�N�g>�@s�dZddlZddlZddlmZddlmZddlmZddl	Z
ddlmm
ZddlmmZddlmZddlmZe�e�Zdd	iZd
d�Zddd�ZdS)zZ
YAML Renderer for Salt

For YAML usage information see :ref:`Understanding YAML <yaml>`.
�N)�ConstructorError)�ParserError)�ScannerError)�SaltRenderError)�OrderedDictz0found character '\t' that cannot start any tokenzIllegal tab charactercCsdd�}|S)z-
    Return the ordered dict yaml loader
    cWs$t�d�rt}nt}|j|dti�S)N�use_yamlloader_oldZ	dictclass)�__opts__�get�yamlloader_old�yamlloader_newZSaltYamlSafeLoaderr)�args�
yamlloader�r�G/opt/saltstack/salt/lib/python3.10/site-packages/salt/renderers/yaml.py�yaml_loader s
z$get_yaml_loader.<locals>.yaml_loaderr)�arglinerrrr�get_yaml_loadersr�base�cs0t�d�r
t�d�t}nt}t|t�s|��}t	j
dd��p}z|j|t|�d�}Wn3t
yL}zt�|j|j�}	|jjd}
t|	|
|jj��d}~wttfy]}zt|��d}~wwt|�dkrw|D]}t�d	|jtjj�|�|�qf|s{i}�fd
d���|�|Wd�S1s�wYdS)z�
    Accepts YAML as a string or as a file object and runs it through the YAML
    parser.

    :rtype: A Python data structure
    rz]Using the old YAML Loader for rendering, consider disabling this and using the tojson filter.T)�record)�Loader�Nrz%s found in %s saltenv=%scs^t|t�r|��D]\}}t|t�rtd���|�q	dSt|t�r+|D]}�|�q$dSdS)a
            PyYAML will for some reason allow improper YAML to be formed into
            an unhashable dict (that is, one with a dict as a key). This
            function will recursively go through and check the keys to make
            sure they're not dicts.
            z)Invalid YAML, possible double curly-braceN)�
isinstance�dict�itemsr�list)�data�key�value�item��_validate_datarrr!Ps

�
�

�zrender.<locals>._validate_data)rr	�log�warningr
rr�str�read�warnings�catch_warnings�loadrr�
_ERROR_MAPZproblemZproblem_mark�liner�bufferrr�len�message�salt�utils�url�create)Z	yaml_dataZsaltenvZslsr�kwsr
Z	warn_listr�excZerr_typeZline_numrrr r�render*sD
�
����$�r4)rrr)�__doc__�loggingr&Zyaml.constructorrZyaml.parserrZyaml.scannerrZsalt.utils.urlr.Zsalt.utils.yamlloaderr/r
rZsalt.utils.yamlloader_oldr
Zsalt.exceptionsrZsalt.utils.odictr�	getLogger�__name__r"r)rr4rrrr�<module>s 
�