HEX
Server: Apache
System: Linux insrv.serversdaddy.com 5.14.0-362.24.2.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Mar 30 14:11:54 EDT 2024 x86_64
User: jsaha (1066)
PHP: 8.3.6
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/cllicense/__pycache__/license_lib.cpython-37.pyc
B

)R�k^6��@s0ddlmZddlZddlZGdd�de�ZdS)�)�absolute_importNc@s6eZdZdd�Zdd�Zdd�Zdd�Zdd
d�Zd	S)
�CloudlinuxLicenseLibcCsd|_d|_d|_dS)Nz/usr/bin/cldetectz/usr/sbin/clnreg_ksz/usr/sbin/clncheck)�_CLDETECT_UTILITY�_CLNREG_KS_UTILITY�_CLNCHECK_UTILITY)�self�r�py/cllicense/license_lib.py�__init__szCloudlinuxLicenseLib.__init__cCs.tj|jddgtjtjd�}|��|jdkS)zr
        Checks Cloudlinux license
        :return: True - license valid
                 False - invalid
        z--check-licensez-q)�stdout�stderrr)�
subprocess�Popenr�PIPE�communicate�
returncode)r�prrr	�get_license_statuss

z'CloudlinuxLicenseLib.get_license_statuscCstj�|j�S)N)�os�path�isfiler)rrrr	�is_edition_migration_available%sz3CloudlinuxLicenseLib.is_edition_migration_availablecCs(tj|jd|gtjtjd�}|��dS)zp
        Register and update Cloudlinux license by key
        :param key: License key
        :return:
        z--update-new-key)rrN)r
rrrr)r�keyrrrr	�"register_and_update_license_by_key)s


z7CloudlinuxLicenseLib.register_and_update_license_by_keyNcCs~|dks|dkrH|jdg}|��r,|�d�tj|tjtjd�}|��|dksX|dkrztj|jdgtjtjd�}|��dS)a
        Register and update Cloudlinux license by IP
        :param stage: Registraton stage.
            None - all stages. Normal mode
            'clnreg_ks' - only clnreg_ks. Only for tests
            'cldetect' - only cldetect. Only for tests
        :return:
        NZ	clnreg_ksz--forcez--migrate-silently)rrZcldetectz--update-license)rr�appendr
rrrr)rZstageZ
clnreg_cmdrrrr	�!register_and_update_license_by_ip7s




z6CloudlinuxLicenseLib.register_and_update_license_by_ip)N)�__name__�
__module__�__qualname__r
rrrrrrrr	rs
r)Z
__future__rr
r�objectrrrrr	�<module>s