diff --git a/leapp-0009-System-enviroment-exception-is-defined.patch b/leapp-0009-System-enviroment-exception-is-defined.patch new file mode 100644 index 0000000000000000000000000000000000000000..ae7509390c668cd8e3a3997b662aab727a16893a --- /dev/null +++ b/leapp-0009-System-enviroment-exception-is-defined.patch @@ -0,0 +1,65 @@ +From bcd452421af220d9ed589e6a7566d42aa6c78aab Mon Sep 17 00:00:00 2001 +From: Weisson +Date: Mon, 6 Mar 2023 11:36:10 +0800 +Subject: [PATCH] System enviroment exception and its process failure exception + are defined. + +Signed-off-by: Weisson +--- + leapp/actors/__init__.py | 3 ++- + leapp/exceptions.py | 18 ++++++++++++++++++ + 2 files changed, 20 insertions(+), 1 deletion(-) + +diff --git a/leapp/actors/__init__.py b/leapp/actors/__init__.py +index 1f55215..cb02806 100644 +--- a/leapp/actors/__init__.py ++++ b/leapp/actors/__init__.py +@@ -6,6 +6,7 @@ from leapp.compat import string_types + from leapp.dialogs import Dialog + from leapp.exceptions import (MissingActorAttributeError, RequestStopAfterPhase, StopActorExecution, + StopActorExecutionError, WorkflowConfigNotAvailable, WrongAttributeTypeError, ++ SystemEnvironmentCheckError, FailureInSystemEnvironmentCheckError, + RPMDownloadOrInstallError) + + from leapp.models import DialogModel, Model +@@ -341,7 +342,7 @@ class Actor(object): + self.process(*args) + except StopActorExecution: + pass +- except RPMDownloadOrInstallError as err: ++ except (FailureInSystemEnvironmentCheckError, SystemEnvironmentCheckError, RPMDownloadOrInstallError) as err: + smc_interface.update_progress_infomation(progress=None, progress_info=err.traceback[:512], err_no=err.err_code, err_msg=str(err.message), path=smc_state_file_path) + self.report_error(err.message, err.severity, err.details) + except StopActorExecutionError as err: +diff --git a/leapp/exceptions.py b/leapp/exceptions.py +index 393273d..deb8fdc 100644 +--- a/leapp/exceptions.py ++++ b/leapp/exceptions.py +@@ -143,6 +143,24 @@ class RPMDownloadOrInstallError(StopActorExecutionError): + super(RPMDownloadOrInstallError, self).__init__(message, severity, details, err_code, traceback) + + ++class SystemEnvironmentCheckError(StopActorExecutionError): ++ """ This exception is used to gracefully stop execution of actor, but allows the workflow to continue. """ ++ # import here to break import cycle ++ from leapp.models.error_severity import ErrorSeverity # pylint: disable=import-outside-toplevel ++ ++ def __init__(self, message, traceback, severity=ErrorSeverity.ERROR, details=None, err_code=101): ++ super(SystemEnvironmentCheckError, self).__init__(message, severity, details, err_code, traceback) ++ ++ ++class FailureInSystemEnvironmentCheckError(StopActorExecutionError): ++ """ This exception is used to gracefully stop execution of actor, but allows the workflow to continue. """ ++ # import here to break import cycle ++ from leapp.models.error_severity import ErrorSeverity # pylint: disable=import-outside-toplevel ++ ++ def __init__(self, message, traceback, severity=ErrorSeverity.ERROR, details=None, err_code=199): ++ super(FailureInSystemEnvironmentCheckError, self).__init__(message, severity, details, err_code, traceback) ++ ++ + class RequestStopAfterPhase(LeappError): + """ + This exception is used to gracefully stop the current actor and request the stop of the workflow execution after +-- +2.35.3 + diff --git a/leapp.spec b/leapp.spec index c80665737970a5d8dd3525a3e59766e2f2cb7922..8af5367b9ca46f3f9461a2ef55237d8dbf7cc144 100644 --- a/leapp.spec +++ b/leapp.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.8 +%define anolis_release .0.9 # IMPORTANT: this is for the leapp-framework capability (it's not the real # version of the leapp). The capability reflects changes in api and whatever # functionality important from the point of repository. In case of @@ -45,6 +45,7 @@ Patch0005: 0005-SMC-progress-indicator.patch Patch0006: leapp-0006-add-customrepo-command.patch Patch0007: leapp-0007-remove-failure-exit-code-check.patch Patch0008: leapp-0008-More-failure-details.patch +Patch0009: leapp-0009-System-enviroment-exception-is-defined.patch %if !0%{?fedora} %if %{with python3} @@ -171,6 +172,7 @@ Python 3 leapp framework libraries. %patch0006 -p1 %patch0007 -p1 %patch0008 -p1 +%patch0009 -p1 ################################################## # Build @@ -293,6 +295,9 @@ rm -f %{buildroot}/%{_bindir}/leapp # no files here %changelog +* Mon Mar 6 2023 Weisson - 0.12.0-1.0.9 +- Provides exceptions for system environment check failure. + * Tue Dec 27 2022 Weisson - 0.12.0-1.0.8 - Provide more failure information for debug propose.