HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-10-0-8-47 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:31:58 UTC 2024 aarch64
User: ubuntu (1000)
PHP: 8.1.2-1ubuntu2.22
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/cloudinit/__pycache__/event.cpython-310.pyc
o

�Ad1�@sxdZddlmZddlmZmZddlmZe�	e
�ZGdd�de�ZGdd�de�Z
d	ed
eeee
ffdd�Zd
S)z0Classes and functions related to event handling.�)�Enum)�Dict�Set)�logc@seZdZdZdd�ZdS)�
EventScope�networkcC�|jS�N��value��self�r�1/usr/lib/python3/dist-packages/cloudinit/event.py�__str__�zEventScope.__str__N)�__name__�
__module__�__qualname__�NETWORKrrrrrrsrc@s(eZdZdZdZdZdZdZdd�ZdS)	�	EventTypezCEvent types which can generate maintenance requests for cloud-init.�bootzboot-new-instancezboot-legacy�hotplugcCrr	r
rrrrr#rzEventType.__str__N)	rrr�__doc__�BOOT�BOOT_NEW_INSTANCE�BOOT_LEGACY�HOTPLUGrrrrrrsr�user_config�returncCs�i}|��D]U\}}zt|�}Wnty+}zt�dt|�|�WYd}~qd}~wwzdd�|dD�}WntyT}zt�dt|�|�g}WYd}~nd}~wwt|�||<q|S)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' scopeNcSsg|]}t|��qSr)r)�.0�xrrr�
<listcomp>>sz&userdata_to_events.<locals>.<listcomp>�when)�itemsr�
ValueError�LOG�warning�str�set)r�
update_config�scope�
scope_list�	new_scope�e�
new_valuesrrr�userdata_to_events's4������r0N)r�enumr�typingrr�	cloudinitr�logging�	getLoggerrr&rr�dictr0rrrr�<module>s

"