L72 d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlmZm Z d dl
Zd dlm
Z
dZdZdZej e ZdZej ed Zej ed Zej ed
ZdZdZd
ZdZeddedddZdZ G d d Z e Z de!fdZ"de!de#fdZ$d Z%d Z&d Z'd Z(d Z)d Z*d Z+dS )! N)errorrequest)mod_makedirsz/usr/sbin/rhn_checkz/usr/sbin/rhnreg_ksz/var/lve/lveinfo.verz/etc/sysconfig/rhnsystemidz jwt.tokenjwt_last_update_tsi i@8 z1/usr/share/cloudlinux/no_valid_license_screen.txtz3/usr/share/cloudlinux/license_out_of_date_email.txtz3Error: License out of date, email template missing.)
template_file error_msgz3Error: No valid license found, template is missing.)EmailNoValidz http://cloudlinux.com/showip.phpc N e Zd ZdZdZdZed Zd Zd Z d Z
d Zd ZdS ) LicenseData c j t j t rt j t sdS t t j t }|t t j t z
k rdS t t }||k rdS dS t j t rGt j t }|t j | k S dS )a
Update license when:
in case JWT token present:
- if no timestamp file with jwt token last update time
- if jwt token was not updated during last 4 hours
- if jwt token was updated later than our timestamp in file
in case JWT token is not present, but systemid exists
(fallback for licensing w/o token)
- update license only if systemid was changed after last timestamp update
when no jwt and no systemid - re-update license
TF)ospathexists JWT_TOKENJWT_TOKEN_TIMESTAMP_FILEintgetmtimetimeJWT_UPDATE_INTERVALread_time_from_fileRHN_SYSTEMID)license_timestamp_filerhn_updatedjwt_last_update_timestamps py/cllicenselib.py_is_license_needs_updatez$LicenseData._is_license_needs_updateK s 7>>)$$ 7>>":;;
tbg..y99::KS--0CCCCt(;