diff options
author | Chris Lumens <clumens@redhat.com> | 2012-10-22 11:03:42 -0400 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2012-10-23 13:21:10 -0400 |
commit | b3e9da0dcbb7004da9b058bdc161a22d34ac4893 (patch) | |
tree | b763ea665d4c6917961193adbc7fc5de6729868c | |
parent | 24567c1355cd378ae24217d29138b35d86b1fb08 (diff) | |
download | anaconda-b3e9da0dcbb7004da9b058bdc161a22d34ac4893.tar.gz anaconda-b3e9da0dcbb7004da9b058bdc161a22d34ac4893.tar.xz anaconda-b3e9da0dcbb7004da9b058bdc161a22d34ac4893.zip |
payloadInstallHandler should only optionally take a package argument (#868542).
-rw-r--r-- | pyanaconda/errors.py | 14 | ||||
-rw-r--r-- | pyanaconda/packaging/yumpayload.py | 6 |
2 files changed, 13 insertions, 7 deletions
diff --git a/pyanaconda/errors.py b/pyanaconda/errors.py index 89b76d566..17e75a0fd 100644 --- a/pyanaconda/errors.py +++ b/pyanaconda/errors.py @@ -214,10 +214,16 @@ class ErrorHandler(object): 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 + package = kwargs.pop("package", None) + if package: + message = _("There was an error installing the %s package. This is " + "a fatal error and installation will be aborted.") % \ + package + else: + message = _("The following error occurred while installing. This is " + "a fatal error and installation will be aborted.") + message += "\n\n" + str(kwargs["exception"]) + self.ui.showError(message) return ERROR_RAISE diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py index b2068278a..73455d42a 100644 --- a/pyanaconda/packaging/yumpayload.py +++ b/pyanaconda/packaging/yumpayload.py @@ -1443,7 +1443,7 @@ class RPMCallback(object): except URLGrabError as e: log.error("URLGrabError: %s" % (e,)) exn = PayloadInstallError("failed to get package") - if errorHandler.cb(exn, txmbr.po) == ERROR_RAISE: + if errorHandler.cb(exn, package=txmbr.po) == ERROR_RAISE: raise exn except (yum.Errors.NoMoreMirrorsRepoError, IOError): if os.path.exists(txmbr.po.localPkg()): @@ -1451,7 +1451,7 @@ class RPMCallback(object): log.debug("retrying download of %s" % txmbr.po) continue exn = PayloadInstallError("failed to open package") - if errorHandler.cb(exn, txmbr.po) == ERROR_RAISE: + if errorHandler.cb(exn, package=txmbr.po) == ERROR_RAISE: raise exn except yum.Errors.RepoError: continue @@ -1491,5 +1491,5 @@ class RPMCallback(object): # unpack problems. if event != rpm.RPMCALLBACK_SCRIPT_ERROR or total: exn = PayloadInstallError("cpio, unpack, or fatal script error") - if errorHandler.cb(exn, name) == ERROR_RAISE: + if errorHandler.cb(exn, package=name) == ERROR_RAISE: raise exn |