%PDF- %PDF-
Mini Shell

Mini Shell

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

�

�f���dZddlZddlmZddlmZmZeje�Z	Gd�de�Z
Gd�de�Zd	ed
ee
eeffd�Z
y)z0Classes and functions related to event handling.�N)�Enum)�Dict�Setc��eZdZdZd�Zy)�
EventScope�networkc��|jS�N��value��selfs �1/usr/lib/python3/dist-packages/cloudinit/event.py�__str__zEventScope.__str__����z�z��N)�__name__�
__module__�__qualname__�NETWORKr�rrrrs���G�rrc�&�eZdZdZdZdZdZdZd�Zy)�	EventTypezCEvent types which can generate maintenance requests for cloud-init.�bootzboot-new-instancezboot-legacy�hotplugc��|jSr
rr
s rrzEventType.__str__"rrN)	rrr�__doc__�BOOT�BOOT_NEW_INSTANCE�BOOT_LEGACY�HOTPLUGrrrrrrs!��M��D�+���K��G�rr�user_config�returnc��i}|j�D];\}}	t|�}	|dD�cgc]
}t
|���}}t|�||<�=|S#t$r*}tj	dt|�|�Yd}~�nd}~wwxYwcc}w#t$r,}tj	dt|�|�g}Yd}~�}d}~wwxYw)aConvert userdata into update config format defined on datasource.

    Userdata is in the form of (e.g):
    {'network': {'when': ['boot']}}

    DataSource config is in the form of:
    {EventScope.Network: {EventType.BOOT}}

    Take the first and return the second
    z.%s! Update data will be ignored for '%s' scopeN�when)�itemsr�
ValueError�LOG�warning�strr�set)r"�
update_config�scope�
scope_list�	new_scope�e�x�
new_valuess        r�userdata_to_eventsr3&s����M�(�.�.�0�3���z�	�"�5�)�I�	�0:�6�0B�C�1�)�A�,�C�J�C�$'�z�?�
�i� �'3�*���%�	��K�K�@��A���
�

��
	��D���	��K�K�@��A���
�
�J��
	�s>�A�B�B	�B�	B� B�B�	B�	C�"B>�>C)r�logging�enumr�typingrr�	getLoggerrr(rr�dictr3rrr�<module>r9s\��6�����g����!��������"!�D�!�T�*�c�)�n�2L�-M�!r

Zerion Mini Shell 1.0