Current File : //proc/self/root/lib/python3/dist-packages/cloudinit/reporting/__pycache__/events.cpython-312.pyc |
�
x[h$ � �$ � d Z ddlZddlZddlZddlZddlmZ ddlm Z ddl
mZmZ ddl
mZ dZdZd Z ej$ e� Z G d
� de� Z ed� Z G d
� d� Z G d� de� Zdd�Zej6 dfd�Zd� Z G d� d� Zd� Zy)z�
events for reporting.
The events here are designed to be used with reporting.
They can be published to registered handlers with report_event.
� N)�List)�performance)�available_handlers�instantiated_handler_registry)�ReportingHandler�finish�start� cloudinitc � � e Zd Zd� Zy)�_namesetc �* � || v r|S t d|z � �)Nz%s not a valid value)�AttributeError)�self�names �</usr/lib/python3/dist-packages/cloudinit/reporting/events.py�__getattr__z_nameset.__getattr__ s � ��4�<��K��3�d�:�;�;� N)�__name__�
__module__�__qualname__r � r r r r s � �<r r )�SUCCESS�WARN�FAILc �( � e Zd ZdZedfd�Zd� Zd� Zy)�ReportingEventz"Encapsulation of event formatting.Nc �v � || _ || _ || _ || _ |�t j � }|| _ y �N)�
event_typer �description�origin�time� timestamp)r r r r r! r# s r �__init__zReportingEvent.__init__, s9 � � %����� �&��������� � ��I�"��r c �d � dj | j | j | j � S )z"The event represented as a string.z
{0}: {1}: {2})�formatr r r �r s r � as_stringzReportingEvent.as_string<