fdZddlZddlmZddlmZmZejeZ GddeZ GddeZ d e d ee ee ffd Z y) z0Classes and functions related to event handling.N)Enum)DictSetceZdZdZdZy) EventScopenetworkc|jSNvalueselfs 1/usr/lib/python3/dist-packages/cloudinit/event.py__str__zEventScope.__str__ zzN)__name__ __module__ __qualname__NETWORKrrrrr sGrrc&eZdZdZdZdZdZdZdZy) EventTypezCEvent types which can generate maintenance requests for cloud-init.bootzboot-new-instancez boot-legacyhotplugc|jSr r r s rrzEventType.__str__"rrN) rrr__doc__BOOTBOOT_NEW_INSTANCE BOOT_LEGACYHOTPLUGrrrrrrs!M D+KGrr user_configreturnci}|jD];\}} t|} |dDcgc] }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' scopeNwhen)itemsr ValueErrorLOGwarningstrrset)r" update_configscope scope_list new_scopeex new_valuess ruserdata_to_eventsr3&sM(..03z "5)I 0:60BC1)A,CJC$'z? i '3* %  KK@A    D  KK@A  J  s> ABB B B BB B C"B>>C)rloggingenumrtypingrr getLoggerrr(rrdictr3rrrr9s\6g!"!D!T*c)n2L-M!r