Edit File: group_info_reader.cpython-37.opt-1.pyc
B �e� � @ s� d dl mZ d dl mZ d dl mZ d dlmZ d dlZd dlmZ d dl Z d dl mZmZ d dl mZmZ d d lmZ G d d� de�ZG dd � d �ZdS )� )�absolute_import)�division)�print_function)�DictN)�sleep)�is_testing_enabled_repo�get_cl_version)� is_ubuntu�get_os_version)�FormattedExceptionc s e Zd Zd� fdd� Z� ZS )�GroupInfoReaderErrorNc s0 |d krd}t t| ��t|t|d�|d�� d S )Nz�Encountered an error while getting the remote available groups info. Try again later. If the same problem occurs again - contact CloudLinux support.)�reason)�message�context�details)�superr �__init__�dict)�selfr r r )� __class__� ��/builddir/build/BUILDROOT/alt-python27-cllib-3.3.5-1.el8.cloudlinux.x86_64/opt/alt/python37/lib/python3.7/site-packages/clcommon/group_info_reader.pyr s zGroupInfoReaderError.__init__)NN)�__name__� __module__�__qualname__r � __classcell__r r )r r r s r c @ sP e Zd ZdZdZdZdZdZedd� �Z edd� �Z ed d � �Zedd� �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 C s | j dkr| �� | _ | j S )z"Get url with available groups jsonN)� GROUP_URL�_get_group_url)�clsr r r � group_url: s zGroupInfoReader.group_urlc C s� t � r2t� \}}|�dd�}d|� d�}| j| S t�� }|dkrFdn|}t� rTdnd}t� }|d krjd S |�d d�}d�d||d g�}| j | | S d 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.jsonZx86_64Zi386ZbetaZstableNZcl7hZcl7z /package-info�json) r r �replace�UBUNTU_BASE�platform�machiner r �join�CL_BASE)r r"