diff options
author | Till Maas <opensource@till.name> | 2011-08-19 20:07:27 +0200 |
---|---|---|
committer | Till Maas <opensource@till.name> | 2011-08-19 20:07:27 +0200 |
commit | adba30551f317092dc775a5a74ebf816e7f03e82 (patch) | |
tree | 675544b316e85e28db753116a591b0b140eaf77f | |
parent | 21c4c44aca34d837a60df4b680e38497b95fd1fc (diff) | |
download | fedora-easy-karma-adba30551f317092dc775a5a74ebf816e7f03e82.tar.gz fedora-easy-karma-adba30551f317092dc775a5a74ebf816e7f03e82.tar.xz fedora-easy-karma-adba30551f317092dc775a5a74ebf816e7f03e82.zip |
Add proper error message for bodhi cache file
Do not show a backtrace when the bodhi cache file cannot be accessed,
but a proper error message instead.
Red Hat bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=718446
-rwxr-xr-x | fedora-easy-karma.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fedora-easy-karma.py b/fedora-easy-karma.py index a0fa84c..64045fe 100755 --- a/fedora-easy-karma.py +++ b/fedora-easy-karma.py @@ -294,9 +294,13 @@ class FedoraEasyKarma(object): cachefile_name = os.path.join(self.options.bodhi_cachedir, "bodhi-cache-%s.cpickle" % release) if self.options.bodhi_cached: self.debug("reading bodhi cache") - cachefile = open(cachefile_name, "rb") - testing_updates = pickle.load(cachefile) - cachefile.close() + try: + cachefile = open(cachefile_name, "rb") + testing_updates = pickle.load(cachefile) + cachefile.close() + except IOError, ioe: + print "Cannot access bodhi cache file: %s" % cachefile_name + sys.exit(ioe.errno) else: self.info("Getting list of packages in updates-testing...") self.debug("starting bodhi query") |