Mini Shell

Direktori : /lib64/python3.6/site-packages/pyanaconda/__pycache__/
Upload File :
Current File : //lib64/python3.6/site-packages/pyanaconda/__pycache__/errors.cpython-36.opt-1.pyc

3

C��e�8�
@s�ddlmZmZddlmZddlmZmZddlm	Z	ddddd	d
ddd
dg
Z
Gdd	�d	e�ZGdd
�d
e�Z
Gdd�de�ZGdd�de�ZGdd
�d
e�ZGdd�de�ZGdd�de�ZGdd�de�ZdZdZdZGdd�de�Ze�ZdS)�)�_�C_)�flags)�BootloaderInstallationError�StorageInstallationError)�UnusableStorageError�ERROR_RAISE�ERROR_CONTINUE�ERROR_RETRY�errorHandler�InvalidImageSizeError�MissingImageError�ScriptError�NonInteractiveError�CmdlineError�	ExitErrorc@seZdZdd�ZdS)rcCstj||�||_dS)N)�	Exception�__init__�filename)�self�messager�r�/usr/lib64/python3.6/errors.pyrszInvalidImageSizeError.__init__N)�__name__�
__module__�__qualname__rrrrrrsc@seZdZdS)r
N)rrrrrrrr
#sc@seZdZdd�ZdS)rcCstj|�||_||_dS)N)rr�lineno�details)rrrrrrr(s
zScriptError.__init__N)rrrrrrrrr'sc@seZdZdS)rN)rrrrrrrr.sc@seZdZdS)rN)rrrrrrrr2sc@seZdZdS)�RemovedModuleErrorN)rrrrrrrr6src@seZdZdd�ZdS)�PasswordCryptErrorcCstj|�||_dS)N)rr�algo)rr rrrr;s
zPasswordCryptError.__init__N)rrrrrrrrr:src@seZdZdS)rN)rrrrrrrr@s��c@s�eZdZdZd'dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZdS)(�ErrorHandlera�This object makes up one part of anaconda's error handling system.  This
       part is the UI-agnostic error callback.  Throughout anaconda, various
       error conditions can occur in places that need to pop up a dialog, but
       should not know anything about the type or details of the UI.  In order
       to accomplish this, each pyanaconda.ui.UserInterface subclass presents a
       common set of dialog methods.

       The entry point to these methods is through the cb method of this class,
       which acts as a dispatcher to the appropriate handler, which in turn
       pops up the correct kind of dialog.  The result of all this is one of the
       ERROR_* constants defined elsewhere in this module.  The original calling
       code must then interpret this result and take the appropriate action.

       For details on the other parts of the error handling system, see the
       documentation for pyanaconda.ui.UserInterface and pyanaconda.exception.
    NcCs
||_dS)N)�ui)rr$rrrrlszErrorHandler.__init__cCs"td�}t|�}|jj||�tS)Nz>An error occurred while activating your storage configuration.)r�strr$�showDetailedErrorr)r�exnrrrrr�_storage_install_handlerosz%ErrorHandler._storage_install_handlercCsBtd�}t|�}tdd�tdd�f}|jj|||d�r:tStSdS)Na�There is a problem with your existing storage configuration or your initial settings, for example a kickstart file. You must resolve this matter before the installation can proceed. There is a shell available for use which you can access by pressing ctrl-alt-f1 and then ctrl-b 2.

Once you have resolved the issue you can retry the storage scan. If you do not fix it you will have to exit the installer.z!GUI|Storage Detailed Error Dialogz_Exit InstallerZ_Retry)�buttons)rr%rr$r&r
r)rr'rrr)rrr�_storage_reset_handlervsz#ErrorHandler._storage_reset_handlercCs&td�|j}|jj|�rtStSdS)Na)The ISO image %s has a size which is not a multiple of 2048 bytes.  This may mean it was corrupted on transfer to this computer.

It is recommended that you exit and abort your installation, but you can choose to continue if you think this is in error. Would you like to continue using this image?)rrr$�showYesNoQuestionr	r)rr'rrrr�_invalidImageSizeHandler�s
z%ErrorHandler._invalidImageSizeHandlercCs td�}|jj|�rtStSdS)Nz�The installer has tried to mount the installation image, but cannot find it on the hard drive.

Should I try again to locate the image?)rr$r+r
r)rr'rrrr�_missingImageHandler�sz!ErrorHandler._missingImageHandlercCs`|jr$td�|j}|jj|�tS|jr:td�|j}ntd�|j}|jj|�rXtStSdS)Nz�The group '%s' is required for this installation. This group does not exist. This is a fatal error and installation will be aborted.z�You have specified that the group '%s' should be installed.  This group does not exist.  Would you like to ignore this group and continue with installation?z�You have specified that the group '%s' should be excluded from installation.  This group does not exist.  Would you like to ignore this group and continue with installation?)	Zrequiredr�groupr$�	showErrorrZaddingr+r	)rr'rrrr�_noSuchGroupHandler�s
z ErrorHandler._noSuchGroupHandlercCsh|j}|j}|j}dj|�}|s(|s(|rD|td�}|jj|�tS|td�}|jj|�r`t	StSdS)Nz{}

zNSome packages, groups or modules are broken, the installation will be aborted.z=Would you like to ignore this and continue with installation?)
Zerror_pkg_specsZerror_group_specs�module_depsolv_errors�formatrr$r/rr+r	)rr'Zbroken_packagesZbroken_groups_modulesr1rrrr�_install_specs_handler�s
z#ErrorHandler._install_specs_handlercCs td�d|i}|jj|�tS)Nz�Stream was not specified for a module without a default stream. This is a fatal error and installation will be aborted. The details of this error are:

%(exception)s�	exception)rr$r/r)rr'rrrr�_no_module_stream_specified�s
z(ErrorHandler._no_module_stream_specifiedcCs td�d|i}|jj|�tS)Nz�Multiple streams have been specified for a single module. This is a fatal error and installation will be aborted. The details of this error are:

%(exception)sr4)rr$r/r)rr'rrrr�"_multiple_module_streams_specified�s
z/ErrorHandler._multiple_module_streams_specifiedcCs&td�|j|jd�}|jj|�tS)Nz�There was an error running the kickstart script at line %(lineno)s.  This is a fatal error and installation will be aborted.  The details of this error are:

%(details)s)rr)rrrr$r/r)rr'rrrr�_scriptErrorHandler�sz ErrorHandler._scriptErrorHandlercCs(td�}|dt|�7}|jj|�tS)NzgThe following error occurred while installing.  This is a fatal error and installation will be aborted.z

)rr%r$r/r)rr'rrrr�_payloadInstallHandler�sz#ErrorHandler._payloadInstallHandlercCs"td�}t|�}|jj||�tS)Nz{The following software marked for installation has errors.
This is likely caused by an error with your installation source.)rr%r$r&r)rr'rrrrr�_dependencyErrorHandler�sz$ErrorHandler._dependencyErrorHandlercCs0td�}|dt|�7}|jj|�r(tStSdS)Nz�The following error occurred while installing the boot loader. The system will not be bootable. Would you like to ignore this and continue with installation?z

)rr%r$r+r	r)rr'rrrr�_bootLoaderErrorHandler�s
z$ErrorHandler._bootLoaderErrorHandlercCstd�|j}|jj|�tS)Nz4Unable to encrypt password: unsupported algorithm %s)rr r$r/r)rr'rrrr�_passwordCryptErrorHandlersz'ErrorHandler._passwordCryptErrorHandlercCs0td�}|dt|�7}|jj|�r(tStSdS)NzvAn error occurred during Red Hat Insights configuration. Would you like to ignore this and continue with installation?z

)rr%r$r+r	r)rr'rrrr�_insightsErrorHandlers
z"ErrorHandler._insightsErrorHandlercCs8td�}|dtd�t|�7}|jj|�r0tStSdS)Nz�An error occurred during registration attempt triggered by the rhsm kickstart command. This could have happened due to incorrect rhsm command arguments or subscription infrastructure issues. Would you like to ignore this and continue with installation?z

zError detail: )rr%r$r+r	r)rr'rrrr�"_kickstartRegistrationErrorHandlers
z/ErrorHandler._kickstartRegistrationErrorHandlercCs td�}|jj|�rtStSdS)Nz�Failed to enable Red Hat subscription on the installed system.

Your Red Hat subscription might be invalid (such as due to an expired developer subscription).

Would you like to ignore this and continue with installation?)rr$r+r	r)rr'rrrr�&_subscriptionTokenTransferErrorHandler s	z3ErrorHandler._subscriptionTokenTransferErrorHandlerc"Cs�t}|js|�tjs td|��tj|jtj|j	d|j
d|jd|jd|j
d|jd|jd|jd	|jd
|jtj|jd|jd|jd
|jd|jd|ji}|jj|kr�||jj|�}|S)a]This method is the callback that all error handling should pass
           through.  The return value is one of the ERROR_* constants defined
           in this module, though the exact constant returned depends on the
           kind of exception being handled.

           Arguments:

           exn      -- An instance of some Exception.
        z'Non interactive installation failed: %srr
ZNoSuchGroupZNoStreamSpecifiedExceptionZInstallMoreStreamsExceptionZ
MarkingErrorsrZPayloadInstallErrorZDependencyErrorrZInsightsClientMissingErrorZInsightsConnectErrorZKickstartRegistrationErrorZSubscriptionTokenTransferError)rr$rZkspromptrrrr(rr*r,r-r0r5r6r3r7r8r9rr:r;r<r=r>�	__class__)rr'ZrcZ_maprrr�cb/s2

zErrorHandler.cb)N)rrr�__doc__rr(r*r,r-r0r3r5r6r7r8r9r:r;r<r=r>r@rrrrr#[s&

r#N)Zpyanaconda.core.i18nrrZpyanaconda.flagsrZ-pyanaconda.modules.common.errors.installationrrZ(pyanaconda.modules.common.errors.storager�__all__rrr
rrr�ImportErrorrr�RuntimeErrorrrr	r
�objectr#rrrrr�<module>s(