Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/lvestats/lib/commons/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/lvestats/lib/commons/__pycache__/sentry.cpython-311.pyc

�

)�fk��:�ddlmZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZddl
mZddlmZddlmZddlmZmZmZmZdd	lmZddlZd
ZGd�dejj��ZGd
�de��Z Gd�de��Z!Gd�de��Z"d�Z#d�Z$dS)�)�absolute_importN)�cpapi�get_lve_version)�get_rhn_systemid_value)�URLError)�Client)�ThreadedHTTPTransport)�Type�Tuple�Dict�Set)�
TracebackTypezehttps://9713d1296f804031b058b8f2d789d7ac:8ddacae32d8246cf8b25cf826bf3fc0a@cl.sentry.cloudlinux.com/12c��eZdZd�ZdS)�RemoveConnectStringc��|�dg��D]F}|�dg��D]-}t|t��r|�dd���.�GdS)N�frames�vars�connect_string)�get�
isinstance�dict�pop)�self�data�frame�	variabless    ��/builddir/build/BUILDROOT/lve-stats-4.2.8-1.el8.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/lib/commons/sentry.py�filter_stacktracez%RemoveConnectString.filter_stacktracess���X�X�h��+�+�	:�	:�E�"�Y�Y�v�r�2�2�
:�
:�	��i��.�.�:��M�M�"2�D�9�9�9��
:�	:�	:�N)�__name__�
__module__�__qualname__r�rrrrs#������:�:�:�:�:rrc��eZdZdZej��Ze��Zed���Z	ed���Z
d�Zd�Zd�Z
d�ZdS)	�LveStatsSentryFilterz/var/lve/errors_record_listc��t��|_	tj|j��dS#t
$rYdSwxYw�N)�set�_record_list_cache�os�unlink�_record_list_file�OSError��clss r�clear_record_listz&LveStatsSentryFilter.clear_record_list)sP��"%�����	��I�c�+�,�,�,�,�,���	�	�	��D�D�	���s�0�
>�>c��|jtj��dz
kr.|���tj��|_dSdS)Ni��)�_last_clean�timer0r.s r�_clean_muted_recordsz)LveStatsSentryFilter._clean_muted_records2sE���?�T�Y�[�[�5�0�0�0��!�!�#�#�#�"�i�k�k�C�O�O�O�1�0rc��	t|jd��5}d�|D��}ddd��n#1swxYwY||vS#t$rYdSwxYw)N�rc�8�g|]}|�d����S)�
)�rstrip)�.0�lines  r�
<listcomp>z7LveStatsSentryFilter.in_record_list.<locals>.<listcomp><s$��:�:�:��$�+�+�d�+�+�:�:�:rF)�openr,�IOError)r�record_fingerprint�f�results    r�in_record_listz#LveStatsSentryFilter.in_record_list8s���	0��d�,�c�2�2�
;�a�:�:��:�:�:��
;�
;�
;�
;�
;�
;�
;�
;�
;�
;�
;����
;�
;�
;�
;�
&��/�/���	�	�	��5�5�	���s'�?�
0�?�4�?�4�?�
A
�A
c���|j�|��	t|jd��5}|�|dz��ddd��dS#1swxYwYdS#t
$rYdSwxYw)N�ar8)r)�addr=r,�writer>)rr?r@s   r�append_to_record_listz*LveStatsSentryFilter.append_to_record_listBs�����#�#�$6�7�7�7�	��d�,�c�2�2�
3�a����*�T�1�2�2�2�
3�
3�
3�
3�
3�
3�
3�
3�
3�
3�
3�
3����
3�
3�
3�
3�
3�
3���	�	�	��D�D�	���s4�A$�A�
A$�A�A$�A�A$�$
A2�1A2c��|�|j|jt|j��dd�|jr|jdjnd��S)N�r�)�check_fingerprint_absent�name�lineno�str�msg�exc_infor )r�records  r�filterzLveStatsSentryFilter.filterKsT���,�,��K��M���
�O�O�C�R�C� �+1�?�B�F�O�A��'�'��	D�D�	Drc�\�tj�d��s�td�||||����}|���||jvrdS|�|��r|j�|��dS|�	|��dSdS)N�LVESTATSWITHOUTSENTRYz{0}.{1}.{2}.{3}FT)
r*�environr�repr�formatr4r)rBrErG)rrLrM�message�exc_namer?s      rrKz-LveStatsSentryFilter.check_fingerprint_absentSs����z�~�~�5�6�6�
	�!%�&7�&>�&>��f�g�x�'1�'1�"2�"2���%�%�'�'�'�!�T�%<�<�<��u��$�$�%7�8�8�
��'�+�+�,>�?�?�?��u��*�*�+=�>�>�>��t��5rN)r r!r"r,r3r2r(r)�classmethodr0r4rBrGrRrKr#rrr%r%$s�������5���$�)�+�+�K����������[���*�*��[�*�
0�0�0����D�D�D�����rr%c���eZdZ�fd�Z�xZS)�SafeThreadedHTTPTransportc���	tt|���|||||��dS#t$rYdSwxYwr')�superr\�	send_syncr)r�urlr�headers�
success_cb�
failure_cb�	__class__s      �rr_z#SafeThreadedHTTPTransport.send_syncgs[���	��+�T�2�2�<�<�S�$��Q[�]g�h�h�h�h�h���	�	�	�
�D�D�	���s�,1�
?�?)r r!r"r_�
__classcell__�rds@rr\r\es8���������������rr\c�8��eZdZe��Zd�Z�fd�Z�xZS)�LveStatsSentryClientc���|\}}}tj|��d\}}}}tj�|��}|j�||d|j��S)N���rJ)�	traceback�
extract_tbr*�path�basename�_filterrKr )rrP�type_�_�tb�filepath�line_norLs        r�is_new_exceptionz%LveStatsSentryClient.is_new_exceptionssg�����q�"�"+�"6�r�":�":�2�">���'�1�a��w����)�)���|�4�4��'�2�u�~�/�/�	/rc�~��tt|���|��o|�|��Sr')r^rh�should_captureru)rrPrds  �rrwz#LveStatsSentryClient.should_capture}s:����)�4�0�0�?�?��I�I�3��(�(��2�2�	3r)r r!r"r%rorurwrerfs@rrhrhpsU�������"�"�$�$�G�/�/�/�3�3�3�3�3�3�3�3�3rrhc�H�ttt���}d|_d|_|�dt
d��i��d|jd<	tj	��|jd<n#tj
$r
d	|jd<YnwxYwtj|jd
<t��\}}|�d	n||jd<t
d��|jd
<t
d��|jd<	tjj�d��}|d}t#|d��dkp@t$j�d�tjj����}n##t,$rtjj}d}YnwxYw||jd<||_ddg|_|j�t6��|j�t8��|j�d��t;|���|S)N)�	transportTi��id�	system_idz	lve-stats�Project�Email�unknownzControl Panel Name�LVE�
os_releasezCloud Linux version�architecture�Architecturez.elr��z3/root/rpmbuild/RPMS/noarch/lve-stats-{0}.noarch.rpm�	Developer�sentry�ravenz<lvestats.eventloop.plugin_executors.PluginExecutionException)�client)rh�DSNr\�auto_log_stacks�string_max_length�user_contextr�tagsr�get_admin_email�NotSupported�CP_NAMEr�lvestats�version�VERSION�split�lenr*rm�existsrW�
IndexError�release�
exclude_paths�ignore_exceptionsrE�
SystemExit�KeyboardInterrupt�test_sentry_message)r��lve_versionrqr�r��is_developers      r�init_sentry_clientr��s!��
!��+����F�"�F��"�F��
����5�k�B�B�C�D�D�D�(�F�K�	��)�$�4�6�6���G������)�)�)�(���G����)����(-�
�F�K�$�%�$�&�&�N�K��&1�&9���{�F�K���)?��)M�)M�F�K�%�&�"8��"H�"H�F�K�����"�*�0�0��7�7���!�*���7�1�:����*�d�b�g�n�n�A�H�H��IY�Ia�b�b�/d�/d���������"�*���������� ,�F�K����F�N�$�g�.�F��
�� � ��,�,�,�
�� � �!2�3�3�3�
�� � �!_�`�`�`��v�&�&�&�&��Ms%�A5�5B�B�6BE=�=F�Fc��tj�d��r:d�}|j���}||_|�d��dSdS)N�LVESTATSSENTRYDONTSENDc�.�tjd��dS)Ng�?)r3�sleep)rrarbrcs    r�	dont_sendz&test_sentry_message.<locals>.dont_send�s���J�s�O�O�O�O�Orz"Something went fundamentally wrong)r*rUr�remote�
get_transportr_�captureMessage)r�r�rys   rr�r��sm��	�z�~�~�.�/�/�D�	�	�	��M�/�/�1�1�	�'�	�����B�C�C�C�C�C�
D�Dr)%�
__future__rr*r3rk�logging�raven.processorsr��clcommonrr�clcommon.utilsr�urllib.errorrr�raven.transportr	�typingr
rrr
�typesr�lvestats.versionr�r��
processors�	Processorr�objectr%r\rhr�r�r#rr�<module>r�s���'�&�&�&�&�&�	�	�	�	�����������������+�+�+�+�+�+�+�+�1�1�1�1�1�1�!�!�!�!�!�!�������1�1�1�1�1�1�)�)�)�)�)�)�)�)�)�)�)�)�����������m��:�:�:�:�:�%�*�4�:�:�:�>�>�>�>�>�6�>�>�>�B����� 5����3�3�3�3�3�6�3�3�3�&#�#�#�LD�D�D�D�Dr

Hacked By AnonymousFox1.0, Coded By AnonymousFox