[yum-commits] yum-complete-transaction.py

skvidal at osuosl.org skvidal at osuosl.org
Thu Jun 3 16:31:11 UTC 2010


 yum-complete-transaction.py |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 5b322c0670b49204af479e04a29f5756e3167024
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Thu Jun 3 12:31:03 2010 -0400

    handle corrupt transaction journals
    
    - catch the misc exception when the transaction file is corrupt
    - tell the user to file a bug b/c whatever made their file corrupt is probably not good for their fs
    - deals with https://bugzilla.redhat.com/show_bug.cgi?id=599574

diff --git a/yum-complete-transaction.py b/yum-complete-transaction.py
index fc17335..fb39107 100755
--- a/yum-complete-transaction.py
+++ b/yum-complete-transaction.py
@@ -185,7 +185,13 @@ class YumCompleteTransaction(YumUtilBase):
         timestamp = times[-1]
         print "There are %d outstanding transactions to complete. Finishing the most recent one" % len(times)
         
-        remaining = find_ts_remaining(timestamp, yumlibpath=self.conf.persistdir)
+        try:
+            remaining = find_ts_remaining(timestamp, yumlibpath=self.conf.persistdir)
+        except yum.Errors.MiscError, e:
+            self.logger.error("Error: %s" % e)
+            self.logger.error("Please report this error to: %s" % self.conf.bugtracker_url)
+            sys.exit(1)
+            
         print "The remaining transaction had %d elements left to run" % len(remaining)
         for (action, pkgspec) in remaining:
             if action == 'install':


More information about the Yum-commits mailing list