§ ;Š»j%ãóˆ—ddlZddlmZddlmZddlZddlmZmZm Z m Z ddl m Z Gd„de ¦«Z Gd„d ¦«ZdS) éN)Úsleep)ÚDict)Úis_testing_enabled_repoÚget_cl_versionÚ is_ubuntuÚget_os_version)ÚFormattedExceptioncó ‡—eZdZdˆfd„ ZˆxZS)ÚGroupInfoReaderErrorNcó^•—|€d}t¦« |d|i|dœ¦«dS)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)ÚsuperÚ__init__)Úselfr rrÚ __class__s €úš/builddir/build/BUILDROOT/alt-python27-cllib-3.4.44-1.el8.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/group_info_reader.pyrzGroupInfoReaderError.__init__sSø€Ø ˆ?ðbð õ ‰Œ×ÒØØ  &Ð)Øð ð ñ ô ð ð ð ó)NN)Ú__name__Ú __module__Ú __qualname__rÚ __classcell__)rs@rr r s=ø€€€€€ð  ð  ð  ð  ð  ð  ð  ð  ð  ð  rr cóz—eZdZdZdZdZdZdZed„¦«Z ed„¦«Z ed„¦«Z ed„¦«Z dS) Ú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€| ¦«|_|jS)z"Get url with available groups json)Ú GROUP_URLÚ_get_group_url)Úclss rÚ group_urlzGroupInfoReader.group_url4s'€ð Œ=Ð Ø×.Ò.Ñ0Ô0ˆCŒMØŒ}Ðrcó†—t¦«r7t¦«\}}| dd¦«}d|›d�}|j|zSt j¦«}|dkrdn|}t ¦«rdnd}t¦«}|€d S| d d ¦«}d d ||d g¦«}|j |z|zS)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.jsonÚx86_64Úi386ÚbetaÚstableNÚcl7hÚcl7z /package-infoÚjson) rrÚreplaceÚ UBUNTU_BASEÚplatformÚmachinerrÚjoinÚCL_BASE)r r$Úubuntu_versionÚsuffixÚarchÚrepoÚ cl_versions rrzGroupInfoReader._get_group_url<sÞ€õ ‰;Œ;ð 5Ý .Ñ 0Ô 0Ñ ˆAˆ~à+×3Ò3°C¸Ñ=Ô=ˆNØ: ^Ð:Ð:Ð:ˆFØ”? VÑ+Ð +åÔ#Ñ%Ô%ˆDØ! XÒ-Ð-�6�6°4ˆDÝ4Ñ6Ô6ÐD�6�6¸HˆDÝ'Ñ)Ô)ˆJØÐ!Ø�tà#×+Ò+¨F°EÑ:Ô:ˆJØ—X’X˜°°d¸FÐCÑDÔDˆFØ”; Ñ+¨fÑ4Ð 4rc óΗ|j�|jS| ¦«}|€tdd¬¦«‚d}t|¦«D]�} t j|d¬¦« ¦«|_|jcS#tjj$rN}|dz|kr)d |›d �}t|›d �|t|¦«¬ ¦«|‚t|dz¦«Yd}~Œ–d}~wwxYwiS) zv Sends request to group url, gets json and converts it to dict :return: dict with groups info Nz%Could not identify CloudLinux versionz‘Could not identify CloudLinux version (using kernel version). Restart your system. If the same problem occurs again - contact CloudLinux support.)réé)ÚtimeoutézUnable to reach z£. Check your internet connection or try again later. If the same problem occurs again - contact CloudLinux support.z - link unavailable)rr) Ú GROUP_INFOr!r ÚrangeÚrequestsÚgetr+Ú exceptionsÚRequestExceptionÚstrr)r ÚurlÚattemptsÚiÚexÚ err_messages rÚget_available_groupsz$GroupInfoReader.get_available_groupsYs:€ð Œ>Ð %Ø”>Ð !Ø�mŠm‰oŒoˆØ ˆ;Ý&Ø7ð1ðñôð ðˆÝ�x‘”ð ð ˆAð Ý!)¤¨c¸2Ð!>Ñ!>Ô!>×!CÒ!CÑ!EÔ!E�”Ø”~Ð%Ð%Ð%øÝÔ&Ô7ð ð ð Ø�q‘5˜HÒ$Ð$ð#7°Sð#7ð#7ð#7�Kõ/ØÐ3Ð3Ð3Ø +Ý # B¡¤ðñôðð õ �a˜!‘e‘ ” � � � � � � øøøøð øøøðˆ sÁ 3BÂC"ÂACÃC"có²—i}| ¦«}| di¦«D])}||vr#| ||d|i¦«Œ*|S)aÞ Filter dict with all available groups by special group name E.g: group = python we will get dict like that: {'alt-python27': {'version': '2.7.15', 'name': 'alt-python27', 'release': '1.el6'}, 'alt-python33': {'version': '3.3.3', 'name': 'alt-python33', 'release': '1.el6'}, 'alt-python34': {'version': '3.4.4', 'name': 'alt-python34', 'release': '1.el6'}...} :param group :rtype: dict with info per group Ú groups_info)rHr?Úupdate)r ÚgroupÚ group_infoÚavailable_groupsÚgrps rÚget_group_infozGroupInfoReader.get_group_info~sp€ðˆ Ø×3Ò3Ñ5Ô5ÐØ#×'Ò'¨ °rÑ:Ô:ð Oð OˆCؘˆ|ˆ|Ø×!Ò! 3Ð(8¸Ô(GÈÔ(LÐ"MÑNÔNÐNøØÐr) rrrÚ__doc__r<rr1r-Ú classmethodr!rrHrP©rrrr sŸ€€€€€ð ð ð€JØ€IØ2€GØB€Kàððñ„[ððð5ð5ñ„[ð5ð8ð"ð"ñ„[ð"ðHððñ„[ðððrr)r.ÚtimerÚtypingrr>Úclcommon.utilsrrrrÚclcommon.clexceptionr r rrSrrúrXsÚðð€€€ØÐÐÐÐÐØÐÐÐÐÐà€€€Ø]Ð]Ð]Ð]Ð]Ð]Ð]Ð]Ð]Ð]Ð]Ð]Ø3Ð3Ð3Ð3Ð3Ð3ð  ð  ð  ð  ð  Ð-ñ  ô  ð  ðpðpðpðpðpñpôpðpðpðpr