Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/clconfigure/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/clconfigure/__pycache__/watcher.cpython-311.pyc

�

��f���ddlZddlZddlZddlZddlZddlmZmZddlm	Z	ej
dde	��ZdZdZ
dZd	Zd
ezZd�Zd�Zd
�Zd�Zd�Zddefd�Zd�ZdS)�N)�
CLEditions�CLEditionDetectionError)�PKG_VERSIONz\.el\w(h?)\.z.elX.zehttps://9713d1296f804031b058b8f2d789d7ac:8ddacae32d8246cf8b25cf826bf3fc0a@cl.sentry.cloudlinux.com/12z/var/lve/.edition.previousz/etc/sysconfig/rhn/systemidi�Q�c�Z�tjd|rdndd|gddtj���dS)z$
    Run reconfiguration script
    z/usr/sbin/cloudlinux-customizer�preconfigure�reconfigurez-tT)�check�text�stderrN)�
subprocess�run�STDOUT��current_edition�is_pre_checks  �J/opt/cloudlinux/venv/lib64/python3.11/site-packages/clconfigure/watcher.py�_reconfigure_serverr!sM���N�)�&�9���M��o��'+�
�*�+�	������c�&�t||��dS)z?
    Called when saved edition does not match current one.
    N�r)�previous_editionrrs   r�_on_edition_changedr0������6�6�6�6�6rc�&�t||��dS)zI
    Called when saved server id detected as one registered recently
    Nrrs  r�_on_server_newly_registeredr7rrc�n�	tj�t��S#t$rYdSwxYw)zV
    Assume that last registration time is
    the date of systemid modification.
    N)�os�path�getmtime�SYSTEMID_FILE_PATH�FileNotFoundError�rr�_get_registration_timer$>s@��
��w��� 2�3�3�3�������t�t������#&�
4�4c�n�	tj�t��S#t$rYdSwxYw)zZ
    Assume that last check time is equal
    to the date of last cache modification.
    N)rrr �LAST_KNOWN_EDITION_CACHE_PATHr"r#rr�_get_last_check_timer(Is@��
��w��� =�>�>�>�������t�t����r%F�new_editionc��	tt��5}|���}ddd��n#1swxYwYn#t$rd}YnwxYwt	��}|o||k}|duo|tj��tz
k}t��}|dup|duo||ko|}tj	dt|��t|��t|����|rC|rAtj	dt|��t|����t||��nf|rBtj	dt|��t|����t|||��n"tj	dt|����|s4tj	dt|����t|���dSdS)a	
    Compares current edition with latest saved in file and
    @param new_edition:
        provides information about new edition that server is using
        Depending on is_pre_check this edition can either be already applied
        or just planning to be installed
    @param is_pre_check:
        True means that current check is executed BEFORE
        new jwt is actually saved in jwt.token file

        False means that registration is complete and jwt.token file
        was updated with new edition token
    NzYChecking edition registration data: registration time=%s, last edition=%s, new edition=%szJNew server registration detected, last check time=%s, registration time=%sz8Edition change detected, last edition=%s, new edition=%sz6Nothing to do, requested edition=%s already configuredzSaving new edition="%s")�edition)�openr'�readr"r$�time�SYSTEMID_NEW_TIMEr(�logging�info�strrr�save_edition)	r)r�f�last_edition�registration_time�is_edition_changed�is_registration_fresh�last_check_time�!is_last_check_before_registrations	         rr
r
Tsd���
�/�
0�
0�	$�A��6�6�8�8�L�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$����	$�	$�	$�	$���������������/�0�0��%�E�,�+�*E��	��%�	C��$�)�+�+�0A�"A�B��+�,�,�O�
�D�	 �	P�!��-�O�#�&7�7�O�<N�&�
�L�l��&�'�'��\�"�"��[�!�!�#�#�#�
)�a�-B�a���a���)�)��*�+�+�	-�	-�	-�	$�K��>�>�>�>�	�a���O���&�&���%�%�	'�	'�	'�	�L�+�|�D�D�D�D���M�s�S^�O_�O_�`�`�`��*���.��K�0@�0@�A�A�A��[�)�)�)�)�)�)�*�*s,�A�7�A�;�A�;�A�A�Ac���	ttd��5}|�|��ddd��dS#1swxYwYdS#t$r }t	jd|��Yd}~dSd}~wwxYw)z4
    Stores current edition value in cache file
    �wNz*Unable to detect current edition, error=%s)r,r'�writerr0�warning)r+r4�es   rr3r3�s���I�
�/��
5�
5�	��
�G�G�G����	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	��"�I�I�I���D�a�H�H�H�H�H�H�H�H�H�����I���s4�A�:�A�>�A�>�A�
A1�A,�,A1)F)r0r�rer
r.�clcommon.lib.cleditionrr�	lve_utilsr�sub�PKG_VERSION_TINY�
SENTRY_DSNr'r!�_SECONDS_IN_DAYr/rrrr$r(r2r
r3r#rr�<module>rGs9������	�	�	�	�	�	�	�	�����������������
"�!�!�!�!�!��2�6�/�7�K�@�@��L�
� <��2������'��	�	�	�7�7�7�7�7�7�������;*�;*�s�;*�;*�;*�;*�|I�I�I�I�Ir

Hacked By AnonymousFox1.0, Coded By AnonymousFox