Hacked By AnonymousFox

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

�

�ug$���ddlZddlZddlZddlZddlZddlmZddlmZej	dde��Z
dZdZdZ
d	Zd
ezZd�Zd�Zd
�Zd�Zd�Zddefd�Zd�ZdS)�N)�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_serverrsM���N�)�&�9���M��o��'+�
�*�+�	������c�&�t||��dS)z?
    Called when saved edition does not match current one.
    N�r)�previous_editionrrs   r�_on_edition_changedr-������6�6�6�6�6rc�&�t||��dS)zI
    Called when saved server id detected as one registered recently
    Nrrs  r�_on_server_newly_registeredr4rrc�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'Fs@��
��w��� =�>�>�>�������t�t����r$F�new_editionc��	ttd���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
    �utf-8��encodingNzYChecking 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	Qsi���
�/�'�
B�
B�
B�	$�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�9�A�=�A�=�A�A�Ac���	ttdd���5}|�|��ddd��dS#1swxYwYdS#t$r }t	jd|��Yd}~dSd}~wwxYw)z4
    Stores current edition value in cache file
    �wr*r+Nz*Unable to detect current edition, error=%s)r.r&�writerr2�warning)r-r6�es   rr5r5�s���I�
�/��w�
G�
G�
G�	�1�
�G�G�G����	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	��"�I�I�I���D�a�H�H�H�H�H�H�H�H�H�����I���s7�A	�<�A	�A�A	�A�A	�	
A3�A.�.A3)F)r2r�rerr0�clcommon.lib.cleditionr�	lve_utilsr�sub�PKG_VERSION_TINY�
SENTRY_DSNr&r �_SECONDS_IN_DAYr1rrrr#r'r4r	r5r"rr�<module>rIs!������	�	�	�	�	�	�	�	���������:�:�:�:�:�:�!�!�!�!�!�!��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