܍~c1dZddlmZddlmZmZddlmZej e Z GddeZ GddeZ d ed ee ee ffd Zd S) z0Classes and functions related to event handling.)Enum)DictSet)logceZdZdZdZdS) EventScopenetworkc|jSNvalueselfs 1/usr/lib/python3/dist-packages/cloudinit/event.py__str__zEventScope.__str__ zN)__name__ __module__ __qualname__NETWORKrrrrr s*Grrc(eZdZdZdZdZdZdZdZdS) EventTypezCEvent types which can generate maintenance requests for cloud-init.bootzboot-new-instancez boot-legacyhotplugc|jSr r rs rrzEventType.__str__#rrN) rrr__doc__BOOTBOOT_NEW_INSTANCE BOOT_LEGACYHOTPLUGrrrrrrs@MM D+KGrr user_configreturnci}|D]\}} t|}n@#t$r3}tdt ||Yd}~Nd}~wwxYw d|dD}nB#t$r5}tdt ||g}Yd}~nd}~wwxYwt |||<|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' scopeNc,g|]}t|Sr)r).0xs r z&userdata_to_events..>sCCC1)A,,CCCrwhen)itemsr ValueErrorLOGwarningstrset)r# update_configscope scope_list new_scopee new_valuess ruserdata_to_eventsr7'sM(..0033z "5))II    KK@A    HHHH   CC 60BCCCJJ    KK@A    JJJJJJ  $'z?? i  s,- A*)A%%A*.B C +B;;CN)renumrtypingrr cloudinitrlogging getLoggerrr-rrdictr7rrrr>s66$$$$$$g!!"!D!T*c)n2L-M!!!!!!r