|9e@ddlmZddlZddlmZmZddlmZmZddl m Z ddl m Z ddl mZddlmZdd lmZmZd d lmZdd lmZGd deZdS))absolute_importN)DictList) run_commandExternalProgramFailed) MysqlInfo) MySQLGovernor) getCPName)MODULES_LOGS_DIR)InstallationFailedExceptionUserInterventionNeededError)WizardInstaller)FeatureceZdZejedZdZdZ e j Z fdZ dZdZdZdZd Zd Zd Zd Zd ZxZS)GovernorInstallerz governor.logunknownz*/usr/share/lve/dbgovernor/mysqlgovernor.pyctt|t|_dS)N)superr__init__rgetdb_info)self __class__s P/opt/cloudlinux/venv/lib64/python3.11/site-packages/clwizard/modules/governor.pyrzGovernorInstaller.__init__s; &&//111!{{(( c^|ds} |d}nI#t$r<}|jdt |t |d}~wwxYw|jd|dS|jddS)Nzgovernor-mysqlz*Package installation failed with error: %sz*Yum package was installed successfully: %sz9Skip governor-mysql installation, it is already installed)_is_package_installed_install_packager app_loggererrorstrr info)routerrs r_install_governor_packagez+GovernorInstaller._install_governor_package)s))*:;; ^ =++,<==( = = =%%&RTWX[T\T\]]]133< = O !Ms S S S S S O !\ ] ] ] ] ]s- A37A..A3c|jdtjks|jdtjkrdS |jd}d|jdddddd}||zS#t $rYdSwxYw)Nvendorversion-r.)rrUNKNOWNlowerjoinsplit IndexError)rr(r)s r_prepare_db_optionsz%GovernorInstaller._prepare_db_options4s L "&7&? ? ?|I&*;*CCC4 \(+1133Fggdl95;;C@@CII#NNqQRsSTTGG# #   44 sA7B22 C?Cc |jd|tjddgddS#t $r}t |d}~wwxYw)z Trying to install governor with --wizard key, it detects DB automatically (on DA and cPanel), for other panels we will have blockers for governor module. zInstall governorz --installz--wizard) exit_statusN)r r#!_run_cmd_and_check_special_statusr UTILITY_PATHrr )rr%s r_initialize_governorz&GovernorInstaller._initialize_governorCs  9 O !3 4 4 4  2 24E4RT_4>4@MN 3 P P P P P$ 9 9 9-//S 8 9s>A A  AA c$t|d\}}}||krC|jd|jd|t|dkr+|jd||t |dS)z There is cases when some command can`t be executed without user`s intervention Such scripts/commands returns special exit code, that must be checked T)return_full_outputz$Can`t install governor automaticallyz Reason: %srz2Error occurred during running "%s" Reason is: "%s"N)rr warningr r!r)rcmdr6retcoder$_s rr7z3GovernorInstaller._run_cmd_and_check_special_statusRs &cdCCCa k ! ! O # #$J K K K O # #L# 6 6 6-// / \\ O ! !"WY\^a b b b',, ,\rc|jdtd||dS)Nr(z%Please, install a MySQL server first.)rr r&r9)roptionss rrun_installationz"GovernorInstaller.run_installation`sH < ! )-.UVV V &&((( !!#####rc^ddig}|jd|dddid|S) zh Get list of warnings that should be shown in wizard before module installation messagezPlease create a full database backup (including system tables). MySQL/MariaDB/Percona server will be updated from CloudLinux repositories.r(NzQCould not detect MySQL server. For list of compatible options please see %(url)s.urlzrns'&&&&& ========******999999!!!!!!//////XXXXXXXX!!!!!!""""""PPPPPPPPPPr