%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__/__init__.cpython-312.pyc

�

�f}&�
�X�ddlZddlZddlZddlmZmZmZddlmZm	Z	m
Z
eje�Z
dZdZdZdZeegZdgZd	Zd
Zddd
dddddddddd�Zeeej3��d���ZGd�dej6��Zd�Zd�Zd�Zd�Z d �Z!d!�Z"d"�Z#d#�Z$e
fd$�Z%d&d%�Z&y)'�N)�importer�
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: jinjarrr
c��dt|�z
S)Nr)�len)�es �=/usr/lib/python3/dist-packages/cloudinit/handlers/__init__.py�<lambda>r>s��Q��Q��Z��)�keyc�D�eZdZdd�Zd�Zd�Zejd��Zy)�Handlerc� �||_||_y�N)�handler_version�	frequency)�selfr�versions   r�__init__zHandler.__init__Cs��&���"��rc�T�tj|��d|j��d�S)Nz: [�])r�obj_name�
list_types)rs r�__repr__zHandler.__repr__Gs��'�0�0��6����8I�J�Jrc�|�t|d�std��t|d�D�cgc]}t|��
c}Scc}w)N�prefixesz#Missing prefixes subclass attribute)�hasattr�NotImplementedError�getattr�INCLUSION_TYPES_MAP)r�prefixs  rr!zHandler.list_typesJsF���t�Z�(�%�&K�L�L�&�d�J�7���$�F�+��
��s�9c��t��r)r&)r�args�kwargss   r�handle_partzHandler.handle_partTs��!�#�#rN)�)	�__name__�
__module__�__qualname__rr"r!�abc�abstractmethodr-�rrrrBs,��#�K��	���$��$rr)�	metaclassc
��|j}|tk(s|tk(r	|tk(sy	|j}t	|�}|d}	tjd|||||�|dk(r|j||||||�y|dk(r|j|||||�y|dk(r|j||||�yt
d|z��#t
ttf$rd}Y��wxYw#t$r"tjtd|||||�YywxYw)N��Content-Typez1Calling handler %s (%s, %s, %s) with frequency %s�r.zUnknown module version %sz8Failed calling handler %s (%s, %s, %s) with frequency %s)rrrr�int�	TypeError�
ValueError�AttributeError�LOG�debugr-�	Exceptionr�logexc)	�mod�data�filename�payloadr�headers�mod_freq�mod_ver�content_types	         r�run_partrJYs$���}�}�H��J����%�(�l�*B����%�%���g�,���>�*�L�
��	�	�?������
	
��a�<��O�O��l�H�g�y�'�
���\��O�O�D�,��'�9�M�
��\��O�O�D�,��'�B��8�G�D�E�E��1
�z�>�2������2�	
�����F������	
�	
�s5�C�5C�=C�C�2C�C�C�(D�Dc�4�dti}t||dd||�y�Nr8)�
CONTENT_STARTrJ�rBrCrrFs    r�
call_beginrO�s$��	�
��G�
�S�$��d�I�w�7rc�4�dti}t||dd||�yrL)�CONTENT_ENDrJrNs    r�call_endrR�s$��	���G�
�S�$��d�I�w�7rc���|d}t|z}|d}tjj|dd|z�}|j	d�sd|z}tj||d�|d}	ttj|��}	t|	|d	|�|j|	d
��|dz|d<y#t$rtjtd
||�YywxYw)N�handlercountr�
handlerdirz%sz.pyz%s.pyi��handlersrCT)�initializedr7z7Failed at registering python file: %s (part handler %s))�PART_HANDLER_FN_TMPL�os�path�join�endswithr�
write_file�
fixup_handlerr�
import_modulerO�registerr@rAr>)
�pdata�_ctype�	_filenamerE�curcount�modnamer�modfnamerVrBs
          r�walker_handle_handlerrg�s����^�$�H�"�h�/�G��k�"�I��w�w�|�|�E�,�/���1A�B�H����U�#��h�'���O�O�H�g�u�-��Z� �H�

��H�2�2�7�;�<���3��f�
�y�1�	���#�4��0� (�1���n����
�����E���		
�
�s�-A	B7�7%C�Cc��	t|t�r|jdd�d}n+|dd|zjd��jdd�d}t	|�|k\r|d|}|S#t
$r	|d|}Y|SwxYw)N�
r7r��ignore)�errors)�
isinstance�str�split�decoder�UnicodeDecodeError)�blob�size�starts   r�_extract_first_or_bytesru�s�����d�C� ��J�J�t�Q�'��*�E���1�t�8�$�+�+�8�+�<�B�B�4��K�A�N�E��u�:����%�4�L�E��L�����Q�t����L��s�A$A(�(A:�9A:c��	|jd�S#ttf$r&	|jd�cYS#t$rYY|SwxYwt$rY|SwxYw)N�
string_escape�unicode_escape)�encode�LookupErrorr;r=)�texts r�_escape_stringr|�sl��

��{�{�?�+�+����#��	��;�;�/�0�0���	���K�	���
�	
��K�
�s.��A�6�A�	A�A�A�A�Ac��|d}||jd�vrtjd|�y|tvrt	||||�y|d}||vrt|||d|||d|�y|rSt
|d�}dt|�z}|tk(rtjd	||�ytjd
||�ytjd|�y)Nr8�excludedzcontent_type "%s" is excludedrVrCr�z'%s...'z)Unhandled non-multipart (%s) userdata: %sz0Unhandled unknown content-type (%s) userdata: %szEmpty payload of type %s)
�getr>r?�PART_CONTENT_TYPESrgrJrur|�NOT_MULTIPART_TYPE�warning)rCrDrErFrIrVrt�detailss        r�walker_callbackr��s����>�*�L��t�x�x�
�+�+��	�	�1�<�@���)�)��d�L�(�G�D���J��H��x����\�"���L�������
	
�
�'���4���~�e�4�5���-�-��K�K�;���
�
�K�K�B���
�	�	�	�,�l�;rc�T�d}|j�D]�}|j�dk(r�|j�}|�t}|j	�}|s	t
|z}t
|�}tj|�||d<tj|�}|||||�|dz}��y)Nr�	multipartr8r7)�walk�get_content_maintype�get_content_type�
OCTET_TYPE�get_filename�PART_FN_TPL�dictr>r?r�fully_decoded_payload)	�msg�callbackrC�partnum�part�ctyperDrFrEs	         rr�r�s����G����
����$�$�&�+�5���%�%�'���=��E��$�$�&���"�g�.�H��t�*���	�	�'��"'�����,�,�T�2����x��'�2��A�+��%rc���t|d�s
t|dd�t|d�st|d|�|S|j}|r|tvrtjd||�|S)Nrr7rz&Handler %s has an unknown frequency %s)r%�setattrrrr>r�)rB�def_freq�freqs   rr^r^sb���3�)�*���&��*��3��$���[�(�+�
�J��}�}���D��+��K�K�@�#�t�L��Jrc���	tj|�j�}|j	�}t
D]}|j
|�s�t|cS|S#t$r|cYSwxYwr)r�
decode_binary�lowerrq�lstrip�INCLUSION_SRCH�
startswithr()rE�default�
payload_lcr{s    r�type_from_starts_withr�#su����'�'��0�6�6�8�
��"�"�$�J��-��� � ��&�&�t�,�,�-��N��
�����s�#A�A,�+A,r)'r2�loggingrY�	cloudinitrrr�cloudinit.settingsrrr�	getLoggerr/r>r�r�rQrM�CONTENT_SIGNALSr�rXr�r(�sorted�list�keysr��ABCMetarrJrOrRrgrur|r�r�r^r�r4rr�<module>r�s����	�0�0�D�D��g����!��,��(�
����
� �+�.��*�*��*����%�.�
�(�(�,�8�4�'�
$A�'H�#@�!��(��	�	!�	!�	#�$�+?���
$����$�.-
�`8�8�
�4�$�$$<�R�.!-�	�	r

Zerion Mini Shell 1.0