5/9e ddlmZddlZddlmZmZddlmZddlm Z ddl m Z ddl m Z dd lmZdd lmZGd d e ZdS) )absolute_importN)CageFsCageFsException)check_cagefs_initialized)MODULES_LOGS_DIR)InstallationFailedException)WizardInstaller)ExternalProgramFailed)FeatureceZdZejedZej Z fdZ dZ dZ dZdZdZdZed Zd ZxZS) CagefsInstallerz cagefs.logctt|t|j|_dS)N)logger)superr__init__r app_loggercgfs)self __class__s py/clwizard/modules/cagefs.pyrzCagefsInstaller.__init__s7 ot$$--///$/222 c|j}|j}|jd||dkr|jdSdS)z` Enable all users statuses and after it toggle to initial mode :return: z.Cagefs users status was updated to enabled: %s Disable AllN)r get_user_modeset_enabled_moderinfotoggle_user_mode)r initial_modeouts r_enable_existing_usersz&CagefsInstaller._enable_existing_userssp y..00 i((** MsSSS = ( ( I & & ( ( ( ( ( ) (rc|j}|jd||dkrO|jd|j|jddSdS)NzCurrent mode is: %srzTry to set mode to Enable allzMode was toggled to Enable all)rrrrr)rmodes r_set_enabled_modez!CagefsInstaller._set_enabled_mode)sy&&(( 2D999 = O !@ A A A I & & ( ( ( O !A B B B B B ! rc|ds9 |ddS#t$r}t|d}~wwxYw|jddS)Ncagefsz2Skip package installation, it is already installed)_is_package_installed_install_packager rrr)rerrs r_install_cagefs_packagez'CagefsInstaller._install_cagefs_package1s))(33 W =%%h/////( = = =133< = O !U V V V V Vs. A AA cVts |j}|jd|dS#t $r<}|jdt|t|d}~wwxYw|jddS)NzCagefs was initialized: %sz+Cagefs initialization failed with error: %sz8Initializing was skipped, cagefs was already initialized) rrinitialize_cagefsrrrerrorstrrrr r)s r_initialize_cagefsz"CagefsInstaller._initialize_cagefs:s')) ] =i1133$$%A3GGGGG" = = =%%&SUXY\U]U]^^^133< = O ![ \ \ \ \ \s4A B 7BB c |j}|jd|dS#t$r}t |d}~wwxYw)Nz/Cagefs was enabled, ready for configuration %s)r enable_cagefsrrrrr/s r_enable_cagefszCagefsInstaller._enable_cagefsEsg 9)))++C O !SUX Y Y Y Y Y 9 9 9-//S 8 9s48 AAAc||| |dr||dr|dSdS#t $r<}|jdt|t|d}~wwxYw)Nenable_for_existing_usersenable_for_new_userszCan`t configure options: %s) r*r0r3r!r$rrr-r.r)roptionsr)s rrun_installationz CagefsInstaller.run_installationLs $$&&& !!!  923 .++----. )&&((((( ) ) 9 9 9 O ! !"?S J J J-//S 8 9s8A:: C7B;;Cc ddhS)Nr5r6)clss rsupported_optionsz!CagefsInstaller.supported_optionsYs+-CDDrc |jdk}n,#t$r|jdd}YnwxYwt t d|idS)Nz Enable Allz?Unable to detect cagefs mode, assuming that it is "Disable All"Fr6)already_configuredr7)rrrrwarningboolr)renabled_for_news rinitial_statuszCagefsInstaller.initial_status]s $"i5577<GOO $ $ $ O # #4 5 5 5$OOO  $#''?'A'A"B"B'9    s &A A )__name__ __module__ __qualname__ospathjoinrLOG_FILEr CAGEFS_REQUIRED_CL_COMPONENT_SUPPORTrr!r$r*r0r3r8 classmethodr<rB __classcell__)rs@rrrsw||,l;;H%,^"33333 ) ) )CCCWWW ] ] ]999 9 9 9EE[E       rr) __future__rrFcllimits.cagefs_librr!clconfig.cagefs_statistics_configrclwizard.constantsrclwizard.exceptionsrbaser clcommon.utilsr clcommon.constr rr:rrrVs'&&&&& 77777777FFFFFF//////;;;;;;100000""""""W W W W W oW W W W W r