
    x[h                         S r SSKrSSKJr  SSKJrJr  \R                  " \5      r	 " S S\5      r
 " S S\5      rS	\S
\\
\\   4   4S jrg)z0Classes and functions related to event handling.    N)Enum)DictSetc                       \ rS rSrSrS rSrg)
EventScope   networkc                     U R                   $ Nvalueselfs    1/usr/lib/python3/dist-packages/cloudinit/event.py__str__EventScope.__str__       zz     N)__name__
__module____qualname____firstlineno__NETWORKr   __static_attributes__r   r   r   r   r      s     Gr   r   c                   .    \ rS rSrSrSrSrSrSrS r	Sr
g	)
	EventType   zCEvent types which can generate maintenance requests for cloud-init.bootzboot-new-instancezboot-legacyhotplugc                     U R                   $ r   r   r   s    r   r   EventType.__str__"   r   r   r   N)r   r   r   r   __doc__BOOTBOOT_NEW_INSTANCEBOOT_LEGACYHOTPLUGr   r   r   r   r   r   r      s!    M D+KGr   r   user_configreturnc                    0 nU R                  5        H=  u  p# [        U5      n US    Vs/ s H  n[        U5      PM     nn[        U5      X'   M?     U$ ! [         a+  n[        R	                  S[        U5      U5         SnAMs  SnAff = fs  snf ! [         a,  n[        R	                  S[        U5      U5        / n SnANSnAff = f)zConvert 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_eventsr9   &   s     M(..0	"5)I	0:60BC0B1)A,0BJC $'z? ' 1* %  	KK@A
 	 D 	KK@A
 J	s?   ABBB
B  BBB
C	"CC	)r#   loggingenumr   typingr   r   	getLoggerr   r.   r   r   dictr9   r   r   r   <module>r?      sZ    6   !  "!D !T*c)n2L-M !r   