o
    x[h(  ã                   @   sZ   d Z ddlmZ ddlmZ ddlmZmZ dddiiZdd	„ Z	d
d„ Z
eƒ Ze	eƒ dS )z�
cloud-init reporting framework

The reporting framework is intended to allow all parts of cloud-init to
report events in a structured manner.
é    )ÚType)ÚDictRegistry)ÚHandlerTypeÚavailable_handlersÚloggingÚtypeÚlogc                 C   sf   |   ¡ D ],\}}|stj|dd� q| ¡ }tj| d¡ }t |¡ |di |¤Ž}t ||¡ qdS )zñUpdate the instantiated_handler_registry.

    :param config:
        The dictionary containing changes to apply.  If a key is given
        with a False-ish value, the registered handler matching that name
        will be unregistered.
    T)Úforcer   N© )ÚitemsÚinstantiated_handler_registryÚunregister_itemÚcopyr   Úregistered_itemsÚpopÚregister_item)ÚconfigÚhandler_nameÚhandler_configÚclsÚinstancer
   r
   ú>/usr/lib/python3/dist-packages/cloudinit/reporting/__init__.pyÚupdate_configuration   s   ÿÿ
ôr   c                  C   s   t j ¡ D ]} |  ¡  qd S )N)r   r   ÚvaluesÚflush)Úhandlerr
   r
   r   Úflush_events-   s   
ÿr   N)Ú__doc__Útypingr   Úcloudinit.registryr   Úcloudinit.reporting.handlersr   r   ÚDEFAULT_CONFIGr   r   r   r
   r
   r
   r   Ú<module>   s   ÿ