IXS d dl Z d dlmZ d dlmZ d dlZd dlmZmZm Z m Z d dlmZ G d de Z G d d ZdS ) N)sleep)Dict)is_testing_enabled_repoget_cl_version is_ubuntuget_os_version)FormattedExceptionc e Zd Zd fd Z xZS )GroupInfoReaderErrorNc ^ |d}t |d|i|d d S )NzEncountered an error while getting the remote available groups info. Try again later. If the same problem occurs again - contact CloudLinux support.reason)messagecontextdetails)super__init__)selfr r r __class__s z/builddir/build/BUILD/imunify360-venv-2.6.2/opt/imunify360/venv/lib/python3.11/site-packages/clcommon/group_info_reader.pyr zGroupInfoReaderError.__init__ sS ?b &) )NN)__name__ __module____qualname__r __classcell__)r s @r r r s= r r c z e Zd ZdZdZdZdZdZed Z ed Z ed Zed ZdS ) GroupInfoReaderaZ The purpose of this class is to get remote yum info about available groups: 1. alt-php 2. alt-nodejs 3. alt-ruby 4. alt-python There we get special url with json which depends on machine features: cl version: 6, 7, 6 hybrid architecture: x84_64, i386 enabled testing repositories status: beta, stable Nz"https://repo.cloudlinux.com/other/z.https://repo.cloudlinux.com/cloudlinux-ubuntu/c P | j | | _ | j S )z"Get url with available groups json) GROUP_URL_get_group_url)clss r group_urlzGroupInfoReader.group_url4 s' = ..00CM}r c t r7t \ }}| dd }d| d}| j |z S t j }|dk rdn|}t rdnd}t }|d S | d d }d d||d g }| j |z |z S )a Final url example for CloudLinux: https://repo.cloudlinux.com/other/cl6/package-info.x86_64.stable.json Final url example for Ubuntu: https://repo.cloudlinux.com/cloudlinux-ubuntu/package-info.20_04.json for cl6, arch x86_64 and disabled testing: stable :return: string with the result url or None if the CL version cannot be identified ._z package-info.z.jsonx86_64i386betastableNcl7hcl7z /package-infojson) r r replaceUBUNTU_BASEplatformmachiner r joinCL_BASE)r r$ ubuntu_versionsuffixarchrepo cl_versions r r zGroupInfoReader._get_group_url<