관리-도구
편집 파일: cmt_utils.cpython-311.pyc
� P�Cg� � �~ � d dl Z d dlZd dlZd dlZd dlZd dlmZmZmZ dde fd�Z ddefd�Zd� Z dd�Zd � Zdefd �ZdS )� N)�DEFAULT_JWT_ES_TOKEN_PATH�PUSHGATEWAY_ADDRESS�DISABLE_CMT_FILEF�returnc � � t t dd�� � 5 }|� � � � � � }ddd� � n# 1 swxY w Y t j t � d�d|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 �r�utf-8��encodingNz/api/cm/get_backend_activationzX-Auth� )�headers�timeout)�openr �read�strip�requests�getr �raise_for_status�json�JSONDecodeError� exceptions�RequestException�OSError�KeyError�IOError)�raise_exception�f�token�req�activation_infos ��/builddir/build/BUILDROOT/alt-python27-cllib-3.4.17-1.el8.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/lib/cmt_utils.py�client_activation_datar"