qsD ~ d dl Z d dlZd dlZd dlZd dlZd dlmZmZmZ dde fdZ
ddefdZd Z
ddZd Zdefd
ZdS ) N)DEFAULT_JWT_ES_TOKEN_PATHPUSHGATEWAY_ADDRESSDISABLE_CMT_FILEFreturnc t t dd 5 }| }ddd n# 1 swxY w Y t j t dd|id }| | }n=# t j t j
j t t t f$ r | r i cY S w xY w|S ) a3
Check that client is activated.
Absence of JWT token means that client can have volume license like GoDaddy
In this case we return False.
Also we return False in case of some errors:
- Errors during request of status from CM
- Malformed JWT token
- Incorrect answer from CM
rutf-8encodingNz/api/cm/get_backend_activationzX-Auth )headerstimeout)openr readstriprequestsgetr raise_for_statusjsonJSONDecodeError
exceptionsRequestExceptionOSErrorKeyErrorIOError)raise_exceptionftokenreqactivation_infos /builddir/build/BUILDROOT/alt-python27-cllib-3.4.36-1.el9.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/lib/cmt_utils.pyclient_activation_datar" s)
+S7
C
C
C %qFFHHNN$$E % % % % % % % % % % % % % % %l"BBBu%
((** 0
s5 B! 'A B! AB! AAB! !7CCc H t | dd S )NactivateF)r" r )r s r! is_client_enabledr% 6 s !/2266z5III c g }t j d }|rlt j |dd| gddd }t j |dddgddd }t j |dddgddd }| |||g t j d }|r0t j |d
| gddd }| | d d |D S )
z|
Several checks for CM
- ping cmt domain
- ping something that MUST be accessible
- traceroute to CM
pingz-c5FT)checkcapture_outputtextz
google.comzcloudlinux.com
traceroutez-T
c
3 \ K | ]'}d |j d|j d|j d|j d V (dS )z Command: z
Retcode: z
Stdout: z
Stderr: r. N)args
returncodestdoutstderr).0process_datas r!