[PATCH 7/7] Add an error handler for fatal package installation errors (#865291).
Chris Lumens
clumens at redhat.com
Tue Oct 16 21:04:10 UTC 2012
We had everything except the function to display the error. Oops.
---
pyanaconda/errors.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/errors.py b/pyanaconda/errors.py
index 3b8de04..89b76d5 100644
--- a/pyanaconda/errors.py
+++ b/pyanaconda/errors.py
@@ -213,6 +213,14 @@ class ErrorHandler(object):
self.ui.showError(message)
return ERROR_RAISE
+ def _payloadInstallHandler(self, *args, **kwargs):
+ package = args[0]
+ message = _("There was an error installing the %s package. This is "
+ "a fatal error and installation will be aborted.") % \
+ package
+ self.ui.showError(message)
+ return ERROR_RAISE
+
def cb(self, exn, *args, **kwargs):
"""This method is the callback that all error handling should pass
through. The return value is one of the ERROR_* constants defined
@@ -244,7 +252,8 @@ class ErrorHandler(object):
"MediaUnmountError": self._mediaUnmountHandler,
"NoSuchGroup": self._noSuchGroupHandler,
"NoSuchPackage": self._noSuchPackageHandler,
- "ScriptError": self._scriptErrorHandler}
+ "ScriptError": self._scriptErrorHandler,
+ "PayloadInstallError": self._payloadInstallHandler}
if exn.__class__.__name__ in _map:
kwargs["exception"] = exn
--
1.7.11.2
More information about the anaconda-patches
mailing list