403Webshell
Server IP : 178.105.222.151  /  Your IP : 216.73.216.38
Web Server : nginx/1.28.3
System : Linux MNK 7.0.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Wed Apr 22 16:06:43 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.5.4
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/uaclient/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/uaclient/__pycache__/event_logger.cpython-314.pyc
+
��gA ���Rt^RIt^RIt^RIt^RIHtHtHtHtH	t	H
t
^RIHtRt
]]
]]]]3,3,,tRsRt]P$!RR]P&44tRR	lt!R
R4tR#)a$
This module is responsible for handling all events
that must be raised to the user somehow. The main idea
behind this module is to centralize all events that happens
during the execution of Pro commands and allows us to report
those events in real time or through a machine-readable format.
N)�Any�Dict�List�Optional�Set�Union)�	safe_dumpz0.1c�2�\f\4s\#�N)�
_event_logger�EventLogger���7/usr/lib/python3/dist-packages/uaclient/event_logger.py�get_event_loggerrs����#�
�
��rc�D�]tRt^tRt]!4t]!4t]!4tRt	R#)�EventLoggerModez�
Defines event logger supported modes.
Currently, we only support the cli and machine-readable mode. On cli mode,
we will print to stdout/stderr any event that we receive. Otherwise, we
will store those events and parse them for the specified format.
r
N)
�__name__�
__module__�__qualname__�__firstlineno__�__doc__�object�CLI�JSON�YAML�__static_attributes__r
rrrrs����(�C��8�D��8�Drrc�t�V^8�dQhR\\\3,R\\\3,/#)��status�return)r�strr)�formats"r�__annotate__r#,s*����4��S��>��d�3��8�n�rc�>�^RIHp\V!4P44UUu.uFwr#RVRV/NK
	uppVR&VP	RR4VPR.4VP
R.4FpRV9gKVP	R4K	V#uuppi)	�)�get_pro_environment�name�value�environment_vars�origin��services�variants)�
uaclient.utilr&�sorted�items�pop�
setdefault�get)rr&r'r(�services&    r�format_machine_readable_outputr5,s���1�"�"5�"7�"=�"=�"?�@�"�@�K�D�
��w��&�@�"�F����J�J�x������j�"�%�
�:�:�j�"�-���� ��K�K�
�#�.��M��'"s�Bc�&a�]tRt^EtoRtRtV3RlRltV3RlRltV3RlRltR V3R
lRllt	R!V3RlR
llt
R"V3RlRlltR#V3RlRlltV3RlRlt
V3RlRltV3RlRltV3RlRltRtRtRtV3RlRltRtVtR	#)$rc��.Vn.Vn\4Vn\4VnRVnRVn/Vn\PVn
R#)Fr+N��
_error_events�_warning_events�set�_processed_services�_failed_services�
_needs_reboot�_command�_output_contentrr�_event_logger_mode��selfs&r�__init__�EventLogger.__init__FsM�����!���#&�5�� � #����"�����
�!���#2�"5�"5��rc��.Vn.Vn\4Vn\4VnRVnRVn/Vn\PVn
R#)z/Reset the state of the event logger attributes.Fr+Nr8rBs&r�reset�EventLogger.resetSsK�����!���#&�5�� � #����"�����
�!���"1�"5�"5��rc� <�V^8�dQhRS[/#)r�
event_mode)r)r"�
__classdict__s"�rr#�EventLogger.__annotate__^s���-�-��-rc��WnR#)zOSet the event logger mode.

We currently support the CLI, JSON and YAML modes.
N)rA)rCrJs&&r�set_event_mode�EventLogger.set_event_mode^s
��
#-�rc� <�V^8�dQhRS[/#)r�command�r!)r"rKs"�rr#rLes��� � �3� rc��WnR#)zkSet the event logger command.

The command will tell the process_events method which output method
to use.
N)r?)rCrQs&&r�set_command�EventLogger.set_commandes	�� �
rc� <�V^8�dQhRS[/#)r�output_content)r)r"rKs"�rr#rLms���.�.��.rc��WnR#)zlSet the event logger output content.

The command will tell the process_events method which content
to use.
N)r@)rCrWs&&r�set_output_content�EventLogger.set_output_contentms
�� .�rNc�6<�V^8�dQhRS[RS[S[,/#)r�info_msg�end�r!r)r"rKs"�rr#rLus���5�5�S�5�x��}�5rc��V'g\PpVP\P8Xd\WVR7R#R#)z<
Print the info message if the event logger is on CLI mode.
)�filer]N)�sys�stdoutrArr�print)rCr\�	file_typer]s&&&&r�info�EventLogger.infous3����
�
�I��"�"�o�&9�&9�9��(��4�:rc�<�V^8�dQhRS[RS[S[,RS[S[S[S[3,,RS[S[,RS[S[,RS[S[S[S[3,,/#)r�msgr4�
event_dict�code�
event_type�additional_info)r!rrr�EventFieldErrorType)r"rKs"�rr#rLsp���'�'�
�'��#��'���c�#6�6�7�8�	'�
�s�m�'��S�M�
'�"�$�s�C�x�.�1�'rc�t�Vf
V'dRMRpRVRVRVRV/pV'dWgR&VPV4R#)Nr4�system�type�message�message_coderl)�append)rCrhr4rirjrkrl�event_entrys&&&&&&& r�_record_dict_event�EventLogger._record_dict_eventsL����&-��8�J�
�J��w��s��D�	
���-<�)�*����+�&rc
�<�V^8�dQhRS[RS[S[,RS[S[,RS[S[,RS[S[S[S[3,,/#)r�	error_msg�
error_coder4�
error_typerl)r!rr)r"rKs"�rr#rL�sV��������S�M���#��	�
�S�M��"�$�s�C�x�.�1�
rc	��VP\P8wd$VPVVVPVVVR7R#R#)zu
Store an error in the event logger.

However, the error will only be stored if the event logger
is not on CLI mode.
)rhr4rirjrkrlN)rArrrur9)rCrxryr4rzrls&&&&&&r�error�EventLogger.error�sH���"�"�o�&9�&9�9��#�#����-�-��%� /�

$�
�:rc�6<�V^8�dQhRS[RS[S[,/#)r�warning_msgr4r^)r"rKs"�rr#rL�s�����3���#��rc��VP\P8wd!VPVVVPR7R#R#)zx
Store a warning in the event logger.

However, the warning will only be stored if the event logger
is not on CLI mode.
)rhr4riN)rArrrur:)rCrr4s&&&r�warning�EventLogger.warning�s?���"�"�o�&9�&9�9��#�#����/�/�
$�
�:rc� <�V^8�dQhRS[/#�rr4rR)r"rKs"�rr#rL�s���.�.��.rc�<�VPPV4R#r
)r<�add�rCr4s&&r�service_processed�EventLogger.service_processed�s��� � �$�$�W�-rc�0<�V^8�dQhRS[S[,/#)rr,)rr!)r"rKs"�rr#rL�s���/�/��S�	�/rc�<�VPPV4R#r
)r=�update)rCr,s&&r�services_failed�EventLogger.services_failed�s�����$�$�X�.rc� <�V^8�dQhRS[/#r�rR)r"rKs"�rr#rL�s���+�+�c�+rc�<�VPPV4R#r
)r=r�r�s&&r�service_failed�EventLogger.service_failed�s�����!�!�'�*rc� <�V^8�dQhRS[/#)r�reboot_required)�bool)r"rKs"�rr#rL�s���-�-�D�-rc��WnR#r
)r>)rCr�s&&r�needs_reboot�EventLogger.needs_reboot�s��,�rc���VPUu0uFpVR,'gKVR,kK	pp\\PVPV44#uupi)r4)r9�listr;�unionr=)rCr|�services_with_errors&  r�_generate_failed_services�%EventLogger._generate_failed_services�sc���+�+�
�+���Y���
�E�)���+�	�
�
�C�I�I�d�3�3�5H�I�J�J��
s
�A�
Ac�4�R\RVP'gRMRR\VP4R\VP	44RVPRVP
RVP/p^R	IHp\\P!WR
R74R#)
�_schema_version�result�success�failure�processed_services�failed_services�errors�warningsr���DatetimeAwareJSONEncoderT��cls�	sort_keysN)�JSON_SCHEMA_VERSIONr9r/r<r�r:r>r.r�rc�json�dumps)rC�responser�s&  r�_process_events_services�$EventLogger._process_events_services�s����2��t�'9�'9�'9�i�y� �&��)A�)A�"B��v�d�&D�&D�&F�G��d�(�(���,�,��D�.�.�
��	;�
��J�J�x��N�	
rc��\VP4pVP'gRMRVR&VPVR&VPVR&VP\
P8Xd*^RIHp\\P!WRR74R
#VP\
P8Xd\\VRR	74R
#R
#)r�r�r�r�r�r�Tr�F)�default_flow_styleN)r5r@r9r:rArrr.r�rcr�r�rr)rC�outputr�s&  r�_process_events_status�"EventLogger._process_events_status�s���/��0D�0D�E��,0�,>�,>�,>�9�I��x���-�-��x��!�1�1��z���"�"�o�&:�&:�:�>���
�
��D��
�
�
$�
$��(<�(<�
<��)�F�u�=�>�=rc�<�V^8�dQhRR/#)rr Nr
)r"rKs"�rr#rL�s���0�0��0rc��VP\P8wd6VPR8XdVP	4R#VP4R#R#)z�
Creates a json response based on all of the
events stored in the event logger.

The json response will only be created if the event logger
is not on CLI mode.
rN)rArrr?r�r�rBs&r�process_events�EventLogger.process_events�sA���"�"�o�&9�&9�9��}�}��(��+�+�-��-�-�/�	:r)r?r9rAr=r>r@r<r:)NN)NNN)NNNNr
)rrrrrDrGrNrTrYrerur|r�r�r�r�r�r�r�r�r�r�__classdictcell__)rKs@rrrEs�����6�	6�-�-� � �.�.�5�5�'�'�0��0��.�.�/�/�+�+�-�-�K�
�"?�"0�0rr)r�enumr�ra�typingrrrrrr�
uaclient.yamlrr�r!rmrr�unique�Enumrr5rr
rr�<module>r�s�����
�8�8�#����u�S�$�s�C�x�.�%8�9�:���
�����
�d�i�i�
�
�
��2z0�z0r

Youez - 2016 - github.com/yon3zu
LinuXploit