/opt/cloudlinux/venv/lib/python3.11/site-packages/clsummary/__pycache__
NameSizeModeActions
arg_parse.cpython-311.opt-1.pyc28210644editdlrm
arg_parse.cpython-311.pyc28210644editdlrm
hardware_statistics.cpython-311.opt-1.pyc55650644editdlrm
hardware_statistics.cpython-311.pyc55650644editdlrm
net_acct.cpython-311.opt-1.pyc64360644editdlrm
net_acct.cpython-311.pyc64360644editdlrm
rpm_packages_statistics.cpython-311.opt-1.pyc45740644editdlrm
rpm_packages_statistics.cpython-311.pyc45740644editdlrm
storage.cpython-311.opt-1.pyc27530644editdlrm
storage.cpython-311.pyc27530644editdlrm
summary.cpython-311.opt-1.pyc2156330644editdlrm
summary.cpython-311.pyc2156330644editdlrm
utils.cpython-311.opt-1.pyc164580644editdlrm
utils.cpython-311.pyc164580644editdlrm
__init__.cpython-311.opt-1.pyc2160644editdlrm
__init__.cpython-311.pyc2160644editdlrm
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/clsummary/__pycache__/utils.cpython-311.pyc (16458B)
§ VF# c vFãóx—ddlZddlZddlZddlZddlZddlZddlZddlmZm Z m Z m Z ddl m Z mZddlmZddlmZmZddlmZddlmZddlmZdd lmZdd lmZd „Z dd l m!Z!dd l"m#Z#n#e$$reZ!eZ#YnwxYwdZ%dZ&dZ'dZ(ej) *e(d¦«Z+dZ,da-dZ.dZ/Gd„d¦«Z0d„Z1d„Z2d5d„Z3d„Z4d„Z5d6de6d e7d!e7fd"„Z8de6d#e7d!dfd$„Z9d!e7fd%„Z:d!e7fd&„Z;d'e7d!dfd(„Zd+„Z?d,„Z@d-„ZAd.„ZBd/„ZCd0„ZDd1„ZEd6d!ee e e e e7fffd2„ZFd3„ZGd!ee fd4„ZHdS)7éN)ÚOptionalÚDictÚAnyStrÚUnion)ÚdecodeÚ exceptions)ÚDEFAULT_JWT_ES_TOKEN_PATH)Ú WhmApiRequestÚ WhmApiError)Úmkdir)Úprocess_is_running)Úcheck_cagefs_initialized)ÚCL_CONFIG_FILE)Úwrite_file_via_tempfilecó—dS)N©)ÚaÚkws úpy/clsummary/utils.pyÚdummy_none_functionrs€Ø ˆ4ó©Ú"interpreter_versions_short_summary)Úis_clpassenger_activeÚ license_checkÚcl_statistics_enabledÚcl_statistics_rpm_enabledz/var/lvezsummary_status.jsonz%/var/run/cloudlinux_summary.send.lockz./usr/share/cloudlinux/cl_plus/clplus_sender.pyz#/opt/cloudlinux/venv/bin/virtualenvcó—eZdZdZdZdZdZdS)Ú SummaryStatuszæ Status of both, collecting and sending statistics If process still collects statistics -> IN_PROGRESS If statistics collected and sent correctly -> SUCCESS If any error during collecting or sending -> FAILED ÚsuccessÚ in_progressÚfailedN)Ú__name__Ú __module__Ú __qualname__Ú__doc__ÚSUCCESSÚ IN_PROGRESSÚFAILEDrrrrr4s)€€€€€ððð €GØ€KØ €F€F€FrrcóJ—tj t¦«S)zS Checks is virtualenv installed :return: True/False - installed or not )ÚosÚpathÚexistsÚALT_PYTHON_VIRTUALENV_BINrrrÚis_virtualenv_installedr/@s€õ Œ7�>Š>Õ3Ñ 4Ô 4Ð4rc ó—tjdtjddddd¦«} tj|tj|¦«}tjd|¦«d}n#t tf$rYdSwxYw|tjkS)a$ Check if file is locked by another process without acquiring lock. IMPORTANT! This function should NOT be used to check lock acquired by the same process that executes the is_locked() function. For example, when process executes fcntl.lockf(LOCK_FILE), and then the same process executes is_locked(LOCK_FILE), the is_locked(LOCK_FILE) call returns False. Use is_locked() function to check lock acquired by another process only. :param lock_file: file to check lock on :type lock_file: file object or descriptor ÚhhllhhrF) ÚstructÚpackÚfcntlÚF_WRLCKÚF_GETLKÚunpackÚOSErrorÚIOErrorÚF_UNLCK)Ú lock_fileÚ lock_dataÚ lock_queryÚ lock_statuss rÚ is_lockedr?Hs‰€õ” ˜H¥e¤m°Q¸¸1¸aÀÑCÔC€IðÝ”[ ­E¬M¸9ÑEÔEˆ Ý”m H¨jÑ9Ô9¸!Ô<ˆ ˆ øÝ •WÐ ðððàˆuˆuðøøøð �%œ-Ò 'Ð's¦;A"Á"A7Á6A7Fcó„—tjttjtjzd¦«}tj|d¦«tj|dd¬¦«a|stt¦«S tj ttj tj z¦«n#ttf$rYdSwxYwdS)zí Check if processes collecting stats are running already (with --send option in command line) :param acquire_lock: True = acquire lock when possible :type acquire_lock: bool :return bool: True = Processes are running é€Úwúutf-8©ÚencodingTF)r+ÚopenÚ_CL_STATISTICS_LOCK_PATHÚO_WRONLYÚO_CREATÚfchmodÚfdopenÚ_CL_STATISTICS_LOCK_FILEr?r4ÚlockfÚLOCK_EXÚLOCK_NBr8r9)Ú acquire_lockÚ_lock_fds rÚis_sending_process_runningrR]sº€õŒwÕ/µ´½r¼zÑ1IÈ5ÑQÔQ€HÝ„Iˆh˜ÑÔÐÝ!œyØ�# ð ñ ô Ðð ð3ÝÕ1Ñ2Ô2Ð2ðÝ Œ Õ,­e¬m½e¼mÑ.KÑLÔLÐLÐLøÝ •WÐ ððð؈tˆtðøøøà ˆ5sÁ61B(Â(B=Â<B=có~—tjdd¬¦«}t|_| t ¦«|S)zW Retrieves ConfigParser object for /etc/sysconfig/cloudlinux file :return: NT)Ú interpolationÚstrict)Ú configparserÚ ConfigParserÚstrÚ optionxformÚreadr)Úconfigs rÚ _get_configr\xs?€õ Ô &°TØ.2ð4ñ4ô4€Få€FÔØ ‡K‚K•ÑÔÐØ €Mrcóâ— tj¦«}| |¦«| ¦«}t |t dd¬¦«n#t tf$rYdSwxYwdS)z‡ write config to /etc/sysconfig/cloudlinux file :param config: configParser object to write return boolean: True|False i¤Ú cloudlinux_©ÚprefixFT)ÚioÚStringIOÚwriteÚgetvaluerrr8r9)r[Ú string_fpÚcontents rÚ _write_configrg„s{€ð Ý”K‘M”Mˆ Ø� Š �YÑÔÐØ×$Ò$Ñ&Ô&ˆÝ ­¸À}ÐUÑUÔUÐUÐUøÝ •WÐ ððð؈uˆuðøøøà ˆ4s‚AAÁA,Á+A,TÚ parameterÚdefaultÚreturncó®—t¦«}|} | t|¦«}n'#tjtjt f$rYnwxYw|S)zi Retrieves parameter's value from /etc/sysconfig/cloudlinux file, _CL_STATISTICS_SECTION section )r\Ú getbooleanÚ_CL_STATISTICS_SECTIONrVÚNoSectionErrorÚ NoOptionErrorÚ ValueError)rhrir[Úress rÚ_get_config_valuerr”sc€õ‰]Œ]€FØ €Cð Ø×ÒÕ 6¸ ÑBÔBˆˆøÝ Ô '­Ô)CÅZÐ Pð ð ð à ˆð øøøð €Js’.®!AÁAÚvaluec ó¬—t¦«}| t|tt |¦«¦«¦«t |¦«dS)zb Sets parameter's value to /etc/sysconfig/cloudlinux file, _CL_STATISTICS_SECTION section N)r\ÚsetrmrXÚintrg)rhrsr[s rÚ_set_config_valuerw¢sD€õ‰]Œ]€FØ ‡J‚JÕ% yµ#µc¸%±j´j±/´/ÑBÔBÐBÝ�&ÑÔÐÐÐrcó*—tt¦«S)z~ Retrieves statistic collection status from /etc/sysconfig/cloudlinux file :return: True/False - enabled/disabled )rrÚ#_CL_STATISTICS_COLLECT_STATE_OPTIONrrrÚis_statistic_enabledrz«s€õ Õ@Ñ AÔ AÐArcó*—tt¦«S)z‚ Retrieves rpm statistic collection status from /etc/sysconfig/cloudlinux file :return: True/False - enabled/disabled )rrÚ'_CL_STATISTICS_COLLECT_RPM_STATE_OPTIONrrrÚis_statistic_rpm_enabledr}³s€õ ÕDÑ EÔ EÐErÚ is_enabledcó0—tt|¦«dS)z€ Set statistic collection status to /etc/sysconfig/cloudlinux file :param is_enabled: True/False - enabled/disabled N)rwry©r~s rÚ set_statistic_collection_enabledr�»s€õ Õ9¸:ÑFÔFÐFÐFÐFrcó0—tt|¦«dS)z„ Set rpm statistic collection status to /etc/sysconfig/cloudlinux file :param is_enabled: True/False - enabled/disabled N)rwr|r€s rÚ$set_statistic_rpm_collection_enabledrƒÃs€õ Õ=¸zÑJÔJÐJÐJÐJrcó— tj t¦«st t¦«t j|¦«}t|tdd¬¦«dS#ttf$rYdSwxYw)z• Writes statistics send status to file /var/lve/summary_status.json :param status_dict: status dictionary for write to file :return: rAr^r_N) r+r,r-Ú_CL_STATISTICS_DIRÚmkdir_pÚjsonÚdumpsrÚ_CL_STATISTICS_SEND_STATUS_FILEr8r9)Ú status_dictrfs rÚ$write_statistics_send_status_to_filer‹Ës‚€ð  ÝŒw�~Š~Õ0Ñ1Ô1ð (Ý Õ&Ñ 'Ô 'Ð 'Ý”*˜[Ñ)Ô)ˆå Õ)HÈ%ÐXeÐfÑfÔfÐfÐfÐføÝ •WÐ ð ð ð Ø ˆˆð øøøs‚A$A(Á(A=Á<A=có|—d} ttd¬¦«5}| ¦«}ddd¦«n #1swxYwYtj|¦«}|dt jkr"t¦«st j|d<d|d<n)#tttttf$rYnwxYw|S)z’ Retrieves statistics send status from file /var/lve/summary_status.json :return: Dictionary with last send status. None if any error NrCrDÚresultzaCollecting statistics was failed. Error report has been sent to developers and will be fixed soonÚreason)rFr‰rZr‡Úloadsrr(rRr)r8r9rpÚAttributeErrorÚ TypeError)rŠÚfÚ s_contents rÚ$get_statistics_send_status_from_filer”Ûsÿ€ð €Kð  Ý Õ1¸GÐ DÑ DÔ Dð !ÈØŸš™œˆIð !ð !ð !ñ !ô !ð !ð !ð !ð !ð !ð !øøøð !ð !ð !ð !å”j Ñ+Ô+ˆ Ø �xÔ ¥MÔ$=Ò =Ð =Ý2Ñ4Ô4ð >õ%2Ô$8ˆK˜Ñ !ð%`ˆK˜Ñ !øøå •W�j­.½)Ð Dð ð ð Ø ˆð øøøà Ðs/„Bš;¯ B»?¿BÁ?ÁABÂ#B9Â8B9có4—d„t|¦«D¦«S)z‰ Returns list of installed interpreters :param interpreter: str - name of interpreter :rtype: List of InterpreterSummary có —g|] }|j¯ |‘Œ Sr)Ú installed)Ú.0Úis rú z/installed_interpreters_list..ös€Ð VÐ VÐ V�!È!Ì+Ð VˆAÐ VÐ VÐ Vrr)Ú interpreters rÚinstalled_interpreters_listrœðs"€ð WÐ VÕ9¸+ÑFÔFÐ VÑ VÔ VÐVrcó:—t¦«o t¦«S)zÄ Checks that python selector is installed Installed if: - ea-apache24-mod-alt-passenger or alt-mod-passenger is installed - alt-python-virtualenv is installed :rtype: bool ©rr/rrrÚis_python_selector_installedrŸùó€õ !Ñ "Ô "Ð @Õ'>Ñ'@Ô'@Ð@rcó:—t¦«o t¦«S)z Checks that ruby selector is installed Installed if: - ea-apache24-mod-alt-passenger or alt-mod-passenger is installed - alt-python-virtualenv is installed :rtype: bool ržrrrÚis_ruby_selector_installedr¢r rcóV—t¦«ottd¦«¦«S)zà Checks that nodejs selector is installed Installed if: - ea-apache24-mod-alt-passenger or alt-mod-passenger is installed - At least one version is installed :rtype: bool Únodejs)rÚboolrœrrrÚis_nodejs_selector_installedr¦s&€õ !Ñ "Ô "Ð R¥tÕ,GÈÑ,QÔ,QÑ'RÔ'RÐRrcó8—tt¦«¦«S)zn Checks that php selector is installed Installed if: - CageFS is initialized :rtype: bool )r¥rrrrÚis_php_selector_installedr¨s€õ Õ(Ñ*Ô*Ñ +Ô +Ð+rcó”— td¦« ¦«}n#t$rgcYSwxYwd„|dD¦«}|S)z9 Gets packages with set lve limits via extension Úlistpkgscó>—g|]}d|v¯|ddk¯|d‘ŒS)Ú_PACKAGE_EXTENSIONSÚlveÚnamer)r˜Úitems rršz4get_packages_with_lve_extensions..,sD€ðjðjðj°Ø"7¸4Ð"?Ð"?ÀDÐI^ÔD_ÐchÒDhÐDhð $ Fœ|ØDhÐDhÐDhrÚpkg)r Úcallr )r�Úlve_extensions_packagess rÚ get_packages_with_lve_extensionsr³$ss€ðݘzÑ*Ô*×/Ò/Ñ1Ô1ˆˆøÝ ðððØˆ ˆ ˆ ðøøøðjðj¸¸u¼ ðjñjôjÐà "Ð"s ‚!$¤ 3²3c óB— ttd¬¦«5}| ¦« ¦«}ddd¦«n #1swxYwYn#tt f$rYdSwxYw t |dgd|dddœd¬ ¦«}|S#tj$rYdSwxYw) z© Gets (if any) fields cl_plus and client_id from jwt token :return: decoded jwt_token value, None if error jwt_token: result of the successful decoding Úrb)ÚmodeNÚHS256TF)Ú require_expÚ verify_expÚ verify_issÚverify_signatureÚ CloudLinux)Ú algorithmsÚoptionsÚissuer) rFr rZÚstripr8r9rrÚ PyJWTError)Úcheck_expirationÚfileÚ file_contentÚ jwt_tokens rÚget_client_data_from_jwt_tokenrÆ1s€ð Ý Õ+°$Ð 7Ñ 7Ô 7ð /¸4ØŸ9š9™;œ;×,Ò,Ñ.Ô.ˆLð /ð /ð /ñ /ô /ð /ð /ð /ð /ð /ð /øøøð /ð /ð /ð /øøå •WÐ ððð؈tˆtðøøøð ݘ<°W°IØ37Ø2BØ26Ø8=ð$?ð$?ð#/ð 0ñ0ô0ˆ ð Ðøå Ô ððð؈tˆtðøøøsE‚A˜'A ¿ AÁ AÁAÁAÁAÁA,Á+A,Á0B  BÂBcóÀ—|sdS| d¦«sdSttj¦«¦«t| d¦«¦«kS)z. Checks whether license ts is expired NÚexp)ÚgetrvÚtime)Ú token_datas rÚis_active_cloudlinux_licenserÌJsW€ð ð؈tØ �>Š>˜%Ñ Ô ð؈tÝ �tŒy‰{Œ{Ñ Ô �c *§.¢.°Ñ"7Ô"7Ñ8Ô8Ò 8Ð8rcó`— ttd¦«}n#t$rd}YnwxYw|rdndS)z� Retrieves data from status of cl_plus_sender service :return: status of service, Optional[AnyStr] - 'active' - 'inactive' FÚactiveÚinactive)r ÚCL_PLUS_SENDER_FILE_PATHÚFileNotFoundError)r�s rÚget_cl_plus_sender_statusrÒUsL€ðÝ#Õ$<¸eÑDÔDˆˆøÝ ðððØˆˆˆðøøøàÐ -ˆ8ˆ8 :Ð-s ‚˜ '¦')F)T)IrVrar+r‡r4r2rÊÚtypingrrrrÚjwtrrÚclcommon.lib.constsr Úclcommon.lib.whmapi_libr r Úclcommon.clcaptainr r†Úclcommon.utilsr Ú!clconfig.cagefs_statistics_configrÚ cldetectlibrÚsecureiorrÚclselect.clselectctlrÚ clselector.clpassenger_detectlibrÚ ImportErrorrmryr|r…r,Újoinr‰rGrLrÐr.rr/r?rRr\rgrXr¥rrrwrzr}r�rƒr‹r”rœrŸr¢r¦r¨r³rÆrÌrÒrrrúràsððÐÐÐØ € € € Ø € € € Ø € € € Ø € € € Ø € € € Ø € € € Ø0Ð0Ð0Ð0Ð0Ð0Ð0Ð0Ð0Ð0Ð0Ð0à"Ð"Ð"Ð"Ð"Ð"Ð"Ð"à9Ð9Ð9Ð9Ð9Ð9Ø>Ð>Ð>Ð>Ð>Ð>Ð>Ð>Ø/Ð/Ð/Ð/Ð/Ð/Ø-Ð-Ð-Ð-Ð-Ð-ØFÐFÐFÐFÐFÐFØ&Ð&Ð&Ð&Ð&Ð&Ø,Ð,Ð,Ð,Ð,Ð,ðððð0ØGÐGÐGÐGÐGÐGØFÐFÐFÐFÐFÐFÐFøØð0ð0ð0Ø)<Ð&Ø/ÐÐÐð0øøøð )ÐØ&=Ð#Ø*EÐ'ØÐØ"$¤'§,¢,Ð/AÐCXÑ"YÔ"YÐØBÐØÐàKÐØAÐð ð ð ð ð ñ ô ð ð5ð5ð5ð(ð(ð(ð*ðððð6 ð ð ð ð ð ð ð  ð ¨tð ¸tð ð ð ð ð ð¨Tð°dðððððB˜dðBðBðBðBðF $ðFðFðFðFðG°ðG¸$ðGðGðGðGðK°TðK¸dðKðKðKðKð  ð  ð  ð ððð*WðWðWðAðAðAðAðAðAðSðSðSð,ð,ð,ð #ð #ð #ðð¸XÀdÈ6ÐSXÐY_ÐaeÐYeÔSfÐKfÔFgÔ=hððððð29ð9ð9ð . 8¨FÔ#3ð .ð .ð .ð .ð .ð .sÁ! A.Á. A:Á9A: