From 2094edcc7487013b2ee7bee52f9ed2b12697e2d2 Mon Sep 17 00:00:00 2001
From: David Lehman <dlehman@redhat.com>
Date: Wed, 29 Feb 2012 18:05:36 -0600
Subject: [PATCH 2/7] The error handler is not callable. Call the 'cb' method.

---
 pyanaconda/packaging/__init__.py    |    6 +++---
 pyanaconda/packaging/livepayload.py |    2 +-
 pyanaconda/packaging/yumpayload.py  |   16 ++++++++--------
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/pyanaconda/packaging/__init__.py b/pyanaconda/packaging/__init__.py
index 38a4c63..04cc804 100644
--- a/pyanaconda/packaging/__init__.py
+++ b/pyanaconda/packaging/__init__.py
@@ -279,7 +279,7 @@ class Payload(object):
             device.format.setup(mountpoint=mountpoint)
         except StorageError as e:
             exn = PayloadSetupError(str(e))
-            if errorHandler(exn) == ERROR_RAISE:
+            if errorHandler.cb(exn) == ERROR_RAISE:
                 raise exn
 
     def _setupNFS(self, mountpoint, server, path, options):
@@ -296,7 +296,7 @@ class Payload(object):
             isys.mount(url, mountpoint, options=options)
         except SystemError as e:
             exn = PayloadSetupError(str(e))
-            if errorHandler(exn) == ERROR_RAISE:
+            if errorHandler.cb(exn) == ERROR_RAISE:
                 raise exn
 
 
@@ -359,7 +359,7 @@ class ImagePayload(Payload):
     def setup(self, storage):
         if not self.image_file:
             exn = PayloadSetupError("image file not set")
-            if errorHandler(exn) == ERROR_RAISE:
+            if errorHandler.cb(exn) == ERROR_RAISE:
                 raise exn
 
 class ArchivePayload(ImagePayload):
diff --git a/pyanaconda/packaging/livepayload.py b/pyanaconda/packaging/livepayload.py
index a4f9644..53e2f74 100644
--- a/pyanaconda/packaging/livepayload.py
+++ b/pyanaconda/packaging/livepayload.py
@@ -49,5 +49,5 @@ class LiveImagePayload(ImagePayload):
 
         if err:
             exn = PayloadInstallError(err)
-            if errorHandler(exn) == ERROR_RAISE:
+            if errorHandler.cb(exn) == ERROR_RAISE:
                 raise exn
diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 9eec94d..c4dce43 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -184,7 +184,7 @@ reposdir=/etc/yum.repos.d,/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/t
             image = findFirstIsoImage(path)
             if not image:
                 exn = PayloadSetupError("failed to find valid iso image")
-                if errorHandler(exn) == ERROR_RAISE:
+                if errorHandler.cb(exn) == ERROR_RAISE:
                     raise exn
 
             if path.endswith(".iso"):
@@ -476,7 +476,7 @@ reposdir=/etc/yum.repos.d,/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/t
                 log.warning(msg)
 
             exn = DependencyError(msgs)
-            rc = errorHandler(exn)
+            rc = errorHandler.cb(exn)
             if rc == ERROR_RAISE:
                 raise exn
             elif rc == ERROR_RETRY:
@@ -514,7 +514,7 @@ reposdir=/etc/yum.repos.d,/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/t
         except RepoError as e:
             log.error("error populating transaction: %s" % e)
             exn = PayloadInstallError(str(e))
-            if errorHandler(exn) == ERROR_RAISE:
+            if errorHandler.cb(exn) == ERROR_RAISE:
                 raise exn
 
         log.debug("check transaction set")
@@ -540,21 +540,21 @@ reposdir=/etc/yum.repos.d,/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/t
         except PackageSackError as e:
             log.error("error running transaction: %s" % e)
             exn = PayloadInstallError(str(e))
-            if errorHandler(exn) == ERROR_RAISE:
+            if errorHandler.cb(exn) == ERROR_RAISE:
                 raise exn
         except YumRPMTransError as e:
             log.error("error running transaction: %s" % e)
             for error in e.errors:
                 log.error(e[0])
             exn = PayloadInstallError(str(e))
-            if errorHandler(exn) == ERROR_RAISE:
+            if errorHandler.cb(exn) == ERROR_RAISE:
                 raise exn
         except YumBaseError as e:
             log.error("error [2] running transaction: %s" % e)
             for error in e.errors:
                 log.error("%s" % e[0])
             exn = PayloadInstallError(str(e))
-            if errorHandler(exn) == ERROR_RAISE:
+            if errorHandler.cb(exn) == ERROR_RAISE:
                 raise exn
         finally:
             self._yum.ts.close()
@@ -636,7 +636,7 @@ class RPMCallback(object):
                     package_path = repo.getPackage(txmbr.po)
                 except (yum.Errors.NoMoreMirrorsRepoError, IOError):
                     exn = PayloadInstallError("failed to open package")
-                    if errorHandler(exn, txmbr.po) == ERROR_RAISE:
+                    if errorHandler.cb(exn, txmbr.po) == ERROR_RAISE:
                         raise exn
                 except yum.Errors.RepoError:
                     continue
@@ -670,5 +670,5 @@ class RPMCallback(object):
             # unpack problems.
             if event != rpm.RPMCALLBACK_SCRIPT_ERROR or total:
                 exn = PayloadInstallError("cpio, unpack, or fatal script error")
-                if errorHandler(exn, name) == ERROR_RAISE:
+                if errorHandler.cb(exn, name) == ERROR_RAISE:
                     raise exn
-- 
1.7.9.1

