HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/self/root/usr/lib/python3/dist-packages/cloudinit/__pycache__/
Upload File :
Current File : //proc/self/root/usr/lib/python3/dist-packages/cloudinit/__pycache__/user_data.cpython-311.pyc
�

܍~c�9��6�ddlZddlmZddlmZddlmZddlmZddl	m
Z
mZddl	mZ
ddl	mZdd	lmZmZe
je��ZejZejZejZd
ZddgZd
dgZdgZdZdZdZgd�ZdZ dgZ!d�Z"d�Z#dd�Z$Gd�d��Z%d�Z&efd�Z'dS)�N)�MIMEBase)�
MIMEMultipart)�MIMENonMultipart)�MIMEText)�features�handlers)�log)�util)�UrlError�read_file_or_urlzContent-Typez
text/plainztext/x-not-multipartztext/x-include-urlztext/x-include-once-urlztext/cloud-config-archiveztext/cloud-configzapplication/octet-stream)zapplication/gzipzapplication/gzip-compressedzapplication/gzippedzapplication/x-compresszapplication/x-compressedzapplication/x-gunzipzapplication/x-gzipzapplication/x-gzip-compressedzNumber-Attachmentsc��||=|||<dS�N�)�msg�key�values   �5/usr/lib/python3/dist-packages/cloudinit/user_data.py�_replace_headerr<s���C���C��H�H�H�c�V�|d=|�ddt|�����dS)NzContent-Disposition�
attachment)�filename)�
add_header�str)rrs  r�
_set_filenamerAs0���!�"��N�N�(�,��X���N�O�O�O�O�Orc�r�tjrt|��|�t�|��dSr)r�ERROR_ON_USER_DATA_FAILURE�	Exception�LOG�warning)�
error_message�source_exceptions  r�
_handle_errorr#Fs6���*�#��
�&�&�,<�<����M�"�"�"�"�"rc�L�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
dd
�Zd�Zd	S)
�UserDataProcessorc�F�||_tj|��|_dSr)�pathsr
�fetch_ssl_details�ssl_details)�selfr's  r�__init__zUserDataProcessor.__init__Ns"����
��1�%�8�8����rc���t��}t|t��r)|D]%}|�t	|��|���&n#|�t	|��|��|Sr)r�
isinstance�list�_process_msg�convert_string)r*�blob�accumulating_msg�bs    r�processzUserDataProcessor.processRs��(�?�?���d�D�!�!�	F��
G�
G���!�!�.��"3�"3�5E�F�F�F�F�
G�
���n�T�2�2�4D�E�E�E��rc
�H�d�}|���D�]}t|��r�d}|���}tj|��}d}|t
vrl	tj|d���}d}d}nP#tj$r>}	d�|t|��|	��}
t|
|	��Yd}	~	��d}	~	wwxYw|st}|tdgzvr||��}|�|}|r�|�
dd��\}}t||��}
|
�|��|���r"t#|
|�����d	D]*}||vr$t%|
|t'||�����+|
}||krt%|t(|��|t*vr|�||�����|t.vr|�||�����t%|t(|��|�||����
dS)
Nc�*�tj|��Sr)r�type_from_starts_with)�payloads r�
find_ctypez2UserDataProcessor._process_msg.<locals>.find_ctype\s���1�'�:�:�:rF)�quietTz<Failed decompressing payload from {} of length {} due to: {}ztext/x-shellscript�/�)�Launch-Index)�walk�is_skippable�get_content_typer
�fully_decoded_payload�DECOMP_TYPES�decomp_gzip�DecompressionError�format�lenr#�
UNDEF_TYPE�TYPE_NEEDED�splitr�set_payload�get_filenamerrr�CONTENT_TYPE�
INCLUDE_TYPES�_do_include�
ARCHIVE_TYPES�_explode_archive�_attach_part)r*�base_msg�
append_msgr9�part�ctype�
ctype_origr8�was_compressed�er!�maintype�subtype�n_part�hs               rr/zUserDataProcessor._process_msg[s���	;�	;�	;��M�M�O�O�K	0�K	0�D��D�!�!�
���E��.�.�0�0�J��0��6�6�G�"�N�
�\�)�)��"�.�w�e�D�D�D�G�"&�J�%)�N�N���.����0�06��&��G���a�1�1�"�"�-��3�3�3��H�H�H�H����������
(�'�
��[�,@�+A�A�A�A�"�
�7�+�+���}�"���
�$)�K�K��Q�$7�$7�!��'�)�(�G�<�<���"�"�7�+�+�+��$�$�&�&�?�!�&�$�*;�*;�*=�*=�>�>�>�*�A�A�A��D�y�y�'���3�t�A�w�<�<�@�@�@�����
�"�"���l�E�:�:�:��
�%�%�� � ��*�5�5�5���
�%�%��%�%�g�z�:�:�:��
�H�l�E�:�:�:����j�$�/�/�/�/�WK	0�K	0s�!A<�<C	�4C�C	c��|�dd��}d}|���tvrQ	tj|�d�����}|r|�d��}n#t$rYnwxYw|�|}|�|}|�K	|�dtt|������dS#ttf$rYdSwxYwdS)Nr=T��decode�launch-index)�getr@�EXAMINE_FOR_LAUNCH_INDEXr
�	load_yaml�get_payloadrrr�int�
ValueError�	TypeError)r*r�
header_idx�payload_idxr8s     r�_attach_launch_indexz&UserDataProcessor._attach_launch_index�s���W�W�^�T�2�2�
������!�!�%=�=�=�
��.������)E�)E�F�F���>�")�+�+�n�"=�"=�K����
�
�
���
�����!�$�K���$�K��"�
����~�s�3�{�3C�3C�/D�/D�E�E�E�E�E���	�*�
�
�
����
����#�"s#�?A5�5
B�B�0C�C�Cc��tj|dd��}tj�|j�d��d|��S)N�md5�@�data�urlcache)r
�	hash_blob�os�path�joinr'�
get_ipath_cur)r*�entry�entry_fns   r�_get_include_once_filenamez,UserDataProcessor._get_include_once_filename�sD���>�%���3�3���w�|�|��J�$�$�V�,�,�j�(�
�
�	
rc��|���st|t|z��|�|��dSr)rKr�PART_FN_TPLrj)r*r�attached_ids   r�_process_before_attachz(UserDataProcessor._process_before_attach�sE�����!�!�	<��#�{�k�:�;�;�;��!�!�#�&�&�&�&�&rc���d}|���D�]Z}|���}|�d��r,|td��d����}d}n@|�d��r+|td��d����}d}|�d��r��|���}|s��d}d}|r|�|��}|r5tj�	|��rtj|��}�n	t|dd|j
���}|r0|���rtj||jd	�
��|���r|j}n*d�||j��}	t'|	��n�#t($rE}
t+|
��}||vr|d�|��z
}t'||
��Yd}
~
n@d}
~
wt,$r0}d
�||��}	t'|	|��Yd}~nd}~wwxYw|�%t/|��}
|�|
|����\dS)NFz
#include-onceTz#include�#��
)�timeout�retriesr)i�)�modez6Fetching from {} resulted in a invalid http code of {}z
 for url: {0}zFetching from {} resulted in {})�
splitlines�lower�
startswithrF�lstrip�striprwrqrr�isfiler
�	load_filerr)�ok�
write_file�contentsrE�coder#rr�IOErrorr0r/)r*�contentrS�include_once_on�line�lc_line�include_url�include_once_fn�respr!�urle�message�ioe�new_msgs              rrNzUserDataProcessor._do_include�s��� ���&�&�(�(�>	7�>	7�D��j�j�l�l�G��!�!�/�2�2�

(��C��0�0�2�2�3�:�:�<�<��#'����#�#�J�/�/�
(��C�
�O�O�-�-�.�5�5�7�7��#(�����s�#�#�
���*�*�,�,�K��
��"�O��G��
O�"&�"A�"A�+�"N�"N���#
6�2�7�>�>�/�#B�#B�#
6��.��9�9��� 6�+�#� !� "�$(�$4�	���D�'��4�7�7�9�9����+�T�]�������w�w�y�y�	5�"&�-���9�9?�� +�T�Y�:�:�&�&�m�4�4�4����1�1�1�!�$�i�i�G�#�'�1�1��?�#9�#9�+�#F�#F�F��!�'�4�0�0�0�0�0�0�0�0������6�6�6�$E�$L�$L�#�S�%�%�M�"�-��5�5�5�5�5�5�5�5�����	6�����"�(��1�1���!�!�'�:�6�6�6��}>	7�>	7s%�/BG�
I�
;H
�

I�&I�Ic�R�tj|gttf���}|D�]�}t	|t
��rd|i}t	|t��s�2|�dd��}|�d��}|s8t}t	|t��rt}tj||��}|�
dd��\}}	|dkr;t	|t��r|���}t||	���}
n%t!||	��}
|
�|��d	|vrt%|
|d	��d
|vr)|
�dt|d
����t|�����D]j}|���dd	dd
dt,���t.���fvr�N|
�|||���k|�||
����dS)
N)�default�allowedr���typer;r<�text)�_subtyperr`r=zcontent-disposition)r
rcr.�setr-r�dictra�ARCHIVE_UNDEF_TYPE�bytes�ARCHIVE_UNDEF_BINARY_TYPErr7rIr_rrrJrr�keysr��ATTACHMENT_FIELDrLrQ)r*�archiverS�entries�entr��mtyper�rYrZr�headers            rrPz"UserDataProcessor._explode_archives%���.��"�t�S�k�J�J�J���0	/�0	/�C��#�s�#�#�
'� �#�&���c�D�*�*�
���g�g�i��,�,�G��G�G�F�O�O�E��
I�,���g�u�-�-�8�7�G� �6�w��H�H�� %���C�� 3� 3��H�g��6�!�!��g�u�-�-�/�%�n�n�.�.�G��w��9�9�9����x��1�1������(�(�(��S� � ��c�3�z�?�3�3�3���$�$����~�s�3�~�3F�/G�/G�H�H�H��s�x�x�z�z�*�*�
4�
4���<�<�>�>����"�)�$�*�*�,�,� �&�&�(�(�&�������v�s�6�{�3�3�3�3����j�#�.�.�.�.�a0	/�0	/rNc�@�t|vr
d|t<|�#t|tt|����d}	t|�t����}n:#t
tf$r&t|tt|����YnwxYw|S)z
        Return the number of attachments to this MIMEMultipart by looking
        at its 'Number-Attachments' header.
        �0Nr)r�rrrerarfrg)r*�	outer_msg�	new_count�
fetched_counts    r�_multi_part_countz#UserDataProcessor._multi_part_countHs���
�9�,�,�*-�I�&�'�� ��I�'7��Y���H�H�H��
�	M��	�
�
�.>� ?� ?�@�@�M�M���I�&�	M�	M�	M��I�'7��]�9K�9K�L�L�L�L�L�	M�����s�'A$�$4B�Bc��|�|��}|�||dz��|�|��|�||dz��dS)z�
        Attach a message to an outer message. outermsg must be a MIMEMultipart.
        Modifies a header in the outer message to keep track of number of
        attachments.
        r<N)r�r{�attach)r*r�rT�
part_counts    rrQzUserDataProcessor._attach_partZse���+�+�I�6�6�
��#�#�D�*�q�.�9�9�9�����������y�*�q�.�9�9�9�9�9rr)
�__name__�
__module__�__qualname__r+r4r/rjrwr{rNrPr�rQrrrr%r%Ms�������9�9�9� � � �O0�O0�O0�b���0
�
�
�'�'�'�
C7�C7�C7�J2/�2/�2/�h����$	:�	:�	:�	:�	:rr%c�f�|���pd}|���dkrdSdS)Nr��	multipartTF)�get_content_maintyper�)rT�
part_maintypes  rr?r?fs9���-�-�/�/�5�2�M�������+�+��t��5rc�>�|sd}d�}t|t��r|�d��}n|}tj|d���}d|dd����vr(tj|�d����}n|||��}|S)	zJconvert a string (more likely bytes) or a message into
    a mime message.rc��|�dd��\}}t||��}|�|��|S)Nr;r<)rIrrJ)rn�content_typerYrZrs     r�
create_binmsgz%convert_string.<locals>.create_binmsgusB��(�.�.�s�A�6�6���'��x��)�)����������
rzutf-8Fr^s
mime-version:ri)r-r�encoder
rCr��message_from_stringr_)�raw_datar�r��bdatars     rr0r0os�����������(�C� � ������(�(�������U�5�1�1�1�E��5��4��=�.�.�0�0�0�0��&�u�|�|�G�'<�'<�=�=����m�E�<�0�0���Jrr)(rq�email.mime.baser�email.mime.multipartr�email.mime.nonmultipartr�email.mime.textr�	cloudinitrrr	�loggingr
�cloudinit.url_helperrr�	getLoggerr�r�NOT_MULTIPART_TYPEry�
OCTET_TYPErLrHrMrOrGr�r�rBr�rbrrr#r%r?r0rrr�<module>r�s���
�	�	�	�$�$�$�$�$�$�.�.�.�.�.�.�4�4�4�4�4�4�$�$�$�$�$�$�(�(�(�(�(�(�(�(�$�$�$�$�$�$�������;�;�;�;�;�;�;�;��g���!�!���0���"��
�
 �
����3�4��%�'@�A�
�,�-�
�
�
�(��6��	�	�	��(��0�0�����
P�P�P�
#�#�#�#�V:�V:�V:�V:�V:�V:�V:�V:�r���+=������r