HEX
Server: Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System: Linux ns565604.ip-54-39-133.net 4.18.0-553.50.1.el8_10.x86_64 #1 SMP Tue Apr 15 08:09:22 EDT 2025 x86_64
User: greer489 (1034)
PHP: 8.3.19
Disabled: NONE
Upload Files
File: //usr/lib/python3.6/site-packages/cloudinit/__pycache__/event.cpython-36.opt-1.pyc
3

\�me�@srdZddlZddlmZddlmZmZeje�Z	Gdd�de�Z
Gdd�de�Zeee
eefd	�d
d�Z
dS)z0Classes and functions related to event handling.�N)�Enum)�Dict�Setc@seZdZdZdd�ZdS)�
EventScopeZnetworkcCs|jS)N)�value)�self�r�/usr/lib/python3.6/event.py�__str__szEventScope.__str__N)�__name__�
__module__�__qualname__ZNETWORKr
rrrr	rsrc@s(eZdZdZdZdZdZdZdd�ZdS)	�	EventTypezCEvent types which can generate maintenance requests for cloud-init.Zbootzboot-new-instancezboot-legacyZhotplugcCs|jS)N)r)rrrr	r
"szEventType.__str__N)	rrr
�__doc__ZBOOTZBOOT_NEW_INSTANCEZBOOT_LEGACYZHOTPLUGr
rrrr	rsr)�user_config�returnc Cs�i}x�|j�D]�\}}yt|�}Wn6tk
rX}ztjdt|�|�wWYdd}~XnXydd�|dD�}Wn8tk
r�}ztjdt|�|�g}WYdd}~XnXt|�||<qW|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>Zwhen)�itemsr�
ValueError�LOGZwarning�str�set)rZ
update_configZscopeZ
scope_listZ	new_scope�eZ
new_valuesrrr	�userdata_to_events&s(r)rZlogging�enumrZtypingrrZ	getLoggerrrrr�dictrrrrr	�<module>s