HOME


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

܍~c�&�
�r�ddlZddlZddlmZddlmZddlmZmZddlm	Z	m
Z
mZeje
��ZdZdZdZd	ZeegZd
gZdZdZd
dddd
dddddddd�Zeee�����d����ZGd�dej���Zd�Zd�Zd �Z d!�Z!d"�Z"d#�Z#d$�Z$d%�Z%efd&�Z&d(d'�Z'dS))�N)�importer)�log)�
type_utils�util)�FREQUENCIES�
PER_ALWAYS�PER_INSTANCEztext/x-not-multipartzapplication/octet-stream�__end__�	__begin__ztext/part-handlerzpart-handler-%03dz	part-%03dztext/x-include-urlztext/x-include-once-urlztext/x-shellscriptztext/cloud-configztext/cloud-boothookztext/cloud-config-archiveztext/cloud-config-jsonpztext/jinja2�text/x-shellscript-per-boot�text/x-shellscript-per-instance�text/x-shellscript-per-once)z#includez
#include-oncez#!z
#cloud-configz
#part-handlerz#cloud-boothookz#cloud-config-archivez#cloud-config-jsonpz## template: jinjarr
rc�&�dt|��z
S)Nr)�len)�es �=/usr/lib/python3/dist-packages/cloudinit/handlers/__init__.py�<lambda>r?s��Q��Q���Z��)�keyc�B�eZdZdd�Zd�Zd�Zejd���ZdS)�Handler�c�"�||_||_dS�N)�handler_version�	frequency)�selfr�versions   r�__init__zHandler.__init__Ds��&���"����rc�Z�tj|���d|����d�S)Nz: [�])r�obj_name�
list_types�rs r�__repr__zHandler.__repr__Hs.��'�0��6�6�6�6����8I�8I�8I�8I�J�Jrc�t�t|d��std���d�t|d��D��S)N�prefixesz#Missing prefixes subclass attributec�(�g|]}t|��S�)�INCLUSION_TYPES_MAP)�.0�prefixs  r�
<listcomp>z&Handler.list_types.<locals>.<listcomp>Ps-������$�F�+���r)�hasattr�NotImplementedError�getattrr$s rr#zHandler.list_typesKsN���t�Z�(�(�	�%�&K�L�L�L���%�d�J�7�7����
rc��t���r)r/)r�args�kwargss   r�handle_partzHandler.handle_partUs��!�#�#�#rN)r)	�__name__�
__module__�__qualname__rr%r#�abc�abstractmethodr4r)rrrrCsh������#�#�#�#�K�K�K����	��$�$���$�$�$rr)�	metaclassc
�^�|j}|tks|tkr|tksdS	|j}t	|��}n#t
ttf$rd}YnwxYw|d}	t�	d|||||��|dkr|�
||||||��dS|dkr|�
|||||��dS|dkr|�
||||��dSt
d|z���#t$r#tj
td|||||��YdSwxYw)N��Content-Typez1Calling handler %s (%s, %s, %s) with frequency %s�rzUnknown module version %sz8Failed calling handler %s (%s, %s, %s) with frequency %s)rrr	r�int�	TypeError�
ValueError�AttributeError�LOG�debugr4�	Exceptionr�logexc)	�mod�data�filename�payloadr�headers�mod_freq�mod_ver�content_types	         r�run_partrOZs����}�H��J�����%�%�(�l�*B�*B�����%���g�,�,�����z�>�2�������������>�*�L�
��	�	�?������
	
�	
�	
��a�<�<��O�O��l�H�g�y�'�
�
�
�
�
���\�\��O�O�D�,��'�9�M�M�M�M�M�
��\�\��O�O�D�,��'�B�B�B�B�B��8�G�D�E�E�E���	
�	
�	
����F������	
�	
�	
�	
�	
�	
�	
���s5�A�A�A�+?C?�,C?�
C?�-C?�?)D,�+D,c�@�dti}t||dd||��dS�Nr=)�
CONTENT_STARTrO�rGrHrrKs    r�
call_beginrT�s0��	�
��G�
�S�$��d�I�w�7�7�7�7�7rc�@�dti}t||dd||��dSrQ)�CONTENT_ENDrOrSs    r�call_endrW�s0��	���G�
�S�$��d�I�w�7�7�7�7�7rc��|d}t|z}|d}tj�|dd|z��}|�d��sd|z}tj||d��|d}	ttj	|����}	t|	|d	|��|�|	d
���|dz|d<dS#t$r tj
td
||��YdSwxYw)N�handlercountr�
handlerdirz%sz.pyz%s.pyi��handlersrHT)�initializedr<z7Failed at registering python file: %s (part handler %s))�PART_HANDLER_FN_TMPL�os�path�join�endswithr�
write_file�
fixup_handlerr�
import_modulerT�registerrErFrC)
�pdata�_ctype�	_filenamerJ�curcount�modnamer�modfnamer[rGs
          r�walker_handle_handlerrl�s)���^�$�H�"�h�/�G��k�"�I��w�|�|�E�,�/���1A�B�B�H����U�#�#�(��h�'���O�H�g�u�-�-�-��Z� �H�

��H�2�7�;�;�<�<���3��f�
�y�1�1�1�	���#�4��0�0�0� (�1���n������
�
�
����E���		
�	
�	
�	
�	
�	
�
���s�=AC�&D�?Dc�R�	t|t��r|�dd��d}n;|dd|z��d����dd��d}t	|��|kr
|d|�}n#t
$r
|d|�}YnwxYw|S)N�
r<r��ignore)�errors)�
isinstance�str�split�decoder�UnicodeDecodeError)�blob�size�starts   r�_extract_first_or_bytesrz�s�����d�C� � �	O��J�J�t�Q�'�'��*�E�E���1�t�8��$�+�+�8�+�<�<�B�B�4��K�K�A�N�E��u�:�:�����%�4�%�L�E��������Q�t�V����������Ls�B
B
�
B$�#B$c���	|�d��S#ttf$r+	|�d��cYS#t$rYnwxYwYnt$rYnwxYw|S)N�
string_escape�unicode_escape)�encode�LookupErrorr@rB)�texts r�_escape_stringr��s���

��{�{�?�+�+�+����#����	��;�;�/�0�0�0�0�0���	�	�	��D�	�����D��
�
�
�	
��	
����
�Ks7��A�A�A�
A
�
A�A
�
A�	A�Ac�,�|d}||�d��vrt�d|��dS|tvrt	||||��dS|d}||vr(t|||d|||d|��dS|rit
|d��}dt|��z}|tkrt�	d	||��dSt�	d
||��dSt�d|��dS)Nr=�excludedzcontent_type "%s" is excludedr[rHr�z'%s...'z)Unhandled non-multipart (%s) userdata: %sz0Unhandled unknown content-type (%s) userdata: %szEmpty payload of type %s)
�getrCrD�PART_CONTENT_TYPESrlrOrzr��NOT_MULTIPART_TYPE�warning)rHrIrJrKrNr[ry�detailss        r�walker_callbackr��s[���>�*�L��t�x�x�
�+�+�+�+��	�	�1�<�@�@�@����)�)�)��d�L�(�G�D�D�D����J��H��x�����\�"���L�������
	
�	
�	
�	
�	
�
�<�'���4�4���~�e�4�4�5���-�-�-��K�K�;���
�
�
�
�
�
�K�K�B���
�
�
�
�
�	�	�	�,�l�;�;�;�;�;rc��d}|���D]�}|���dkr�|���}|�t}|���}|s
t
|z}t
|��}t�|��||d<tj
|��}|||||��|dz}��dS)Nr�	multipartr=r<)�walk�get_content_maintype�get_content_type�
OCTET_TYPE�get_filename�PART_FN_TPL�dictrCrDr�fully_decoded_payload)	�msg�callbackrH�partnum�part�ctyperIrKrJs	         rr�r�s����G����
�
�����$�$�&�&�+�5�5���%�%�'�'���=��E��$�$�&�&���	/�"�g�.�H��t�*�*���	�	�'����"'�����,�T�2�2�����x��'�2�2�2��A�+���%�rc���t|d��st|dd��t|d��st|d|��n.|j}|r%|tvrt�d||��|S)Nrr<rz&Handler %s has an unknown frequency %s)r.�setattrrrrCr�)rG�def_freq�freqs   rrcrcs����3�)�*�*�+���&��*�*�*��3��$�$�M���[�(�+�+�+�+��}���	M�D��+�+��K�K�@�#�t�L�L�L��Jrc��	tj|�����}n#t$r|cYSwxYw|���}t
D]&}|�|��rt|cS�'|Sr)r�
decode_binary�lowerrv�lstrip�INCLUSION_SRCH�
startswithr*)rJ�default�
payload_lcr�s    r�type_from_starts_withr�$s�����'��0�0�6�6�8�8�
�
���������������"�"�$�$�J��-�-��� � ��&�&�	-�&�t�,�,�,�,�	-��Ns�&)�8�8r)(r8r^�	cloudinitrr�loggingrr�cloudinit.settingsrrr	�	getLoggerr5rCr�r�rVrR�CONTENT_SIGNALSr�r]r�r*�sorted�list�keysr��ABCMetarrOrTrWrlrzr�r�r�rcr�r)rr�<module>r�s���
�
�
�	�	�	�	�������$�$�$�$�$�$�&�&�&�&�&�&�&�&�D�D�D�D�D�D�D�D�D�D��g���!�!��,��(�
����
� �+�.��*�*��*����%�.�
�(�(�,�8�4�'�
$A�'H�#@�!���(���D�	�	!�	!�	#�	#�$�$�+?�+?�����
$�$�$�$�$���$�$�$�$�.-
�-
�-
�`8�8�8�8�8�8�
�
�
�4���$���$$<�$<�$<�R���.!-�	�	�	�	�	�	�	�	�	�	r