%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python37/lib/python3.7/site-packages/clwizard/modules/__pycache__/
Upload File :
Create Path :
Current File : //opt/alt/python37/lib/python3.7/site-packages/clwizard/modules/__pycache__/cagefs.cpython-37.pyc

B

�2Lb��@s�ddlmZddlZddlmZmZddlmZddlm	Z	ddl
mZddlm
Z
dd	lmZdd
lmZGdd�de
�ZdS)
�)�absolute_importN)�CageFs�CageFsException)�check_cagefs_initialized)�MODULES_LOGS_DIR)�InstallationFailedException�)�WizardInstaller)�ExternalProgramFailed)�FeaturecsteZdZej�ed�Zej	Z
�fdd�Zdd�Zdd�Z
dd	�Zd
d�Zdd
�Zdd�Zedd��Zdd�Z�ZS)�CagefsInstallerz
cagefs.logcs tt|���t|jd�|_dS)N)Zlogger)�superr�__init__r�
app_logger�cgfs)�self)�	__class__��H/opt/alt/python37/lib/python3.7/site-packages/clwizard/modules/cagefs.pyrszCagefsInstaller.__init__cCs8|j��}|j��}|j�d|�|dkr4|j��dS)z`
        Enable all users statuses and after it toggle to initial mode
        :return:
        z.Cagefs users status was updated to enabled: %szDisable AllN)r�
get_user_modeZset_enabled_moder�info�toggle_user_mode)rZinitial_mode�outrrr�_enable_existing_userss


z&CagefsInstaller._enable_existing_userscCsF|j��}|j�d|�|dkrB|j�d�|j��|j�d�dS)NzCurrent mode is: %szDisable AllzTry to set mode to Enable allzMode was toggled to Enable all)rrrrr)r�moderrr�_set_enabled_mode)s

z!CagefsInstaller._set_enabled_modecCsF|�d�s6y|�d�WqBtk
r2t��YqBXn|j�d�dS)NZcagefsz6Skip yum package installation, it is already installed)Z_is_package_installedZ_install_yum_packager
rrr)rrrr�_install_cagefs_package1s
z'CagefsInstaller._install_cagefs_packagec
Cspt�s`y|j��}|j�d|�Wqltk
r\}z|j�dt|��t��Wdd}~XYqlXn|j�d�dS)NzCagefs was initialized: %sz)Cagefs initializing failed with error: %sz8Initializing was skipped, cagefs was already initialized)	rrZinitialize_cagefsrrr�error�strr)rr�errr�_initialize_cagefs:s
z"CagefsInstaller._initialize_cagefscCs<y|j��}|j�d|�Wntk
r6t��YnXdS)Nz/Cagefs was enabled, ready for configuration
 %s)rZ
enable_cagefsrrrr)rrrrr�_enable_cagefsEs

zCagefsInstaller._enable_cagefsc
Cs||��|��|��y$|dr*|��|dr:|��Wn:tk
rv}z|j�dt|��t	��Wdd}~XYnXdS)N�enable_for_existing_users�enable_for_new_userszCan`t configure options: %s)
rr r!rrrrrrr)r�optionsrrrr�run_installationLsz CagefsInstaller.run_installationcCsddhS)Nr"r#r)�clsrrr�supported_optionsYsz!CagefsInstaller.supported_optionscCsLy|j��dk}Wn$tk
r6|j�d�d}YnXtt��d|id�S)Nz
Enable Allz?Unable to detect cagefs mode, assuming that it is "Disable All"Fr#)Zalready_configuredr$)rrrrZwarning�boolr)rZenabled_for_newrrr�initial_status]s
zCagefsInstaller.initial_status)�__name__�
__module__�__qualname__�os�path�joinrZLOG_FILErZCAGEFSZ_REQUIRED_CL_COMPONENT_SUPPORTrrrrr r!r%�classmethodr'r)�
__classcell__rr)rrrs	
r)Z
__future__rr-Zcllimits.cagefs_librrZ!clconfig.cagefs_statistics_configrZclwizard.constantsrZclwizard.exceptionsr�baser	Zclcommon.utilsr
Zclcommon.constrrrrrr�<module>	s

Zerion Mini Shell 1.0