g 2ddlZddlmZddlmZddlmZmZddlm Z m Z ddl m Z m Z ddlmZdd lmZdd lmZdd lmZdd lmZdd lmZddlmZddlmZddlmZedefdefdefdefdefdefdefgZ ede Z!dZ"dZ#dZ$dZ%dS)N) OrderedDict)Dict) NoSuchModuleacquire_config_access) ModuleStatus MAIN_LOG_PATH)InstallationFailedExceptionUserInterventionNeededError) setup_logger)WizardInstaller)CagefsInstaller)GovernorInstaller)NodejsInstaller) PhpInstaller)PythonInstaller) RubyInstaller)LsapiInstallercagefsmysql_governornodejsphppythonruby mod_lsapiz wizard.runnercHdtDS)z6Get list of supported modules on current control panelcBi|]\}}|||S)is_supported_by_control_panel).0namemodules py/clwizard/modules/__init__.py z)get_supported_modules...s@   %v  / / 1 1  f   ) ALL_MODULESitemsrr%r#get_supported_modulesr(,s/  )4):):)<)<   r%cNtdtdtjt D]v\}}|}t 5} ||}||}n6#t$r)td|YdddwxYw|tj kr(td| ddd|tj kr(td| ddd|tj kr)td| ddd,||tj dddn #1swxYwYt!||| xtd tjtd dS) z4Install modules according to settings in status filez<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~z7> Start new modules installation in process with pid %s) module_namez.Module %s is not set for installation, skip itNz'Module %s is already installed, skip itz%Module %s has been cancelled, skip itzQModule %s requires a manual installation. Skipping it and continuing installationr* new_state)optionsz0> Process with pid %s successfully finished workz<------------------------------------------------------------)loginfoosgetpidr(r'rget_module_optionsget_module_statusrr INSTALLED CANCELLED AUTO_SKIPPEDset_module_status INSTALLING_install_module)r!installer_class installerconfigr-states r#run_installationr>4sHHXHH F TTT!6!8!8!>!>!@!@::o#O%% " $ $ E  333EE00T0BB   DdLLL E E E E E E E   ...=tEEE E E E E E E E ...;TCCC# E E E E E E E$ 111>?CEEE- E E E E E E E.  $ $ L,C % E E E/ E E E E E E E E E E E E E E E2 i99999HH ?MMMHHXsHG,B43G4%C'G&C''/G",G,G!GG G c \td| ||t|tjtd||dS#t $rNt|tjtd|d|gdt|idt$r:t|tj t d |YdSt$r}t|tjtd||jd t|d|t|dd gdt|idt |d}~wwxYw) NzInstalling module: %sr+z5Module '%s' successfully installed using options '%s'z!Installation failed for module %sz {{ default }}r-) fingerprintdata)extraz0Automatic installation was skipped for module %szcUnknown error occurred, please, retry or contact CloudLinux support if it happens again. Error: %s)r.r/r>_write_module_state_atomicrr4r FAILEDerrorstrr r6warning Exception app_logger exception)r"r;r-errs r#r9r9YsHH $f---"8""7+++< #,*@ B B B B &'-w 8 8 8 8 8? '",*= ? ? ? ? / /8"CLL133  4 4 4  &PPP",*C E E E E FOOOOOO 555",*= ? ? ? ? 5v>>>&&  XX!0S#2#G"CLL1  '   *++45sA++BF+ F+ BF&&F+ct5}|||ddddS#1swxYwYdS)Nr+)rr7)r*r, config_accesss r#rDrDs  VM''K9'UUUVVVVVVVVVVVVVVVVVVs 488)&r0 collectionsrtypingrclwizard.configrrclwizard.constantsrrclwizard.exceptionsr r clwizard.utilsr baser rrgovernorrrrrrrrrrlsapirr&r.r(r>r9rDrr%r#rXs ######????????::::::::XXXXXXXX''''''!!!!!!######''''''############!!!!!! k ()  L  ].!    l?M22"""J%8%8%8PVVVVVr%