Ë
    x[h  ã                   óœ   — d Z ddlZddlmZ ddlmZmZ  ej                  e«      Z	 G d„ de«      Z
 G d„ de«      Zd	ed
ee
ee   f   fd„Zy)z0Classes and functions related to event handling.é    N)ÚEnum)ÚDictÚSetc                   ó   — e Zd ZdZd„ Zy)Ú
EventScopeÚnetworkc                 ó   — | j                   S ©N©Úvalue©Úselfs    ú1/usr/lib/python3/dist-packages/cloudinit/event.pyÚ__str__zEventScope.__str__   ó   € Ø�z‰zÐó    N)Ú__name__Ú
__module__Ú__qualname__ÚNETWORKr   © r   r   r   r      s   „ ð €Gór   r   c                   ó&   — e Zd ZdZdZdZdZdZd„ Zy)Ú	EventTypezCEvent types which can generate maintenance requests for cloud-init.Úbootzboot-new-instancezboot-legacyÚhotplugc                 ó   — | j                   S r
   r   r   s    r   r   zEventType.__str__"   r   r   N)	r   r   r   Ú__doc__ÚBOOTÚBOOT_NEW_INSTANCEÚBOOT_LEGACYÚHOTPLUGr   r   r   r   r   r      s!   „ ÙMð €DØ+ÐØ€KØ€Gór   r   Úuser_configÚreturnc                 óŒ  — i }| j                  «       D ];  \  }}	 t        |«      }	 |d   D �cg c]  }t        |«      ‘Œ }}t        |«      ||<   Œ= |S # t        $ r*}t        j	                  dt        |«      |«       Y d}~Œnd}~ww xY wc c}w # t        $ r,}t        j	                  dt        |«      |«       g }Y d}~Œ}d}~ww xY w)a  Convert 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   Útypingr   r   Ú	getLoggerr   r(   r   r   Údictr3   r   r   r   ú<module>r9      s\   ðá 6ã Ý ß à€g×Ñ˜Ó!€ô�ô ô�ô ð"! Dð !¨T°*¸cÀ)¹nÐ2LÑ-Mô !r   