o
    th(                     @   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 )zUpdate 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   