diff options
| author | Michael E Brown <michael_e_brown@dell.com> | 2007-10-17 19:01:35 -0500 |
|---|---|---|
| committer | Michael E Brown <michael_e_brown@dell.com> | 2007-10-17 19:01:35 -0500 |
| commit | 7e6993f7f65419a9e605ea03e72cacafdd32860a (patch) | |
| tree | 00a7216833b17229630be2c726bdf1ed3c60536e /src | |
| parent | 335e60eb837a3bf67419258a3f59f77ef507c3b7 (diff) | |
| download | mock-7e6993f7f65419a9e605ea03e72cacafdd32860a.tar.gz mock-7e6993f7f65419a9e605ea03e72cacafdd32860a.tar.xz mock-7e6993f7f65419a9e605ea03e72cacafdd32860a.zip | |
fix for idiotic error in rpmUtils where exception comes back with each letter as an element in a tuple.
Diffstat (limited to 'src')
| -rw-r--r-- | src/py-libs/util.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/py-libs/util.py b/src/py-libs/util.py index 89b6235..0545f0c 100644 --- a/src/py-libs/util.py +++ b/src/py-libs/util.py @@ -23,6 +23,7 @@ import logging import os import os.path import popen2 +import rpm import rpmUtils import rpmUtils.transaction import shutil @@ -77,12 +78,11 @@ def getSrpmHeader(srpms): for srpm in srpms: try: hdr = rpmUtils.miscutils.hdrFromPackage(ts, srpm) - except rpmUtils.RpmUtilsError, e: - log.exception("Cannot find/open srpm: %s. Error was: %s" % (srpm, str(e))) - raise mock.exceptions.Error("Cannot find/open srpm: %s. Error was: %s" % (srpm, str(e))) + except (rpmUtils.RpmUtilsError,), e: + raise mock.exception.Error, "Cannot find/open srpm: %s. Error: %s" % (srpm, ''.join(e)) if hdr[rpm.RPMTAG_SOURCEPACKAGE] != 1: - raise mock.exceptions.Error("File is not an srpm: %s." % srpm ) + raise mock.exception.Error("File is not an srpm: %s." % srpm ) yield hdr |
