[yum-commits] Branch 'yum-3_2_X' - yum/rpmtrans.py

James Antill james at osuosl.org
Thu Feb 12 15:19:08 UTC 2009


 yum/rpmtrans.py |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 3645f0afbf44d3312a92243c9fc31e15bd99ee8a
Author: James Antill <james at and.org>
Date:   Thu Feb 12 10:19:02 2009 -0500

    Don't traceback when rpm gives us a bad tagname, BZ 485221

diff --git a/yum/rpmtrans.py b/yum/rpmtrans.py
index 85896fa..8bc8e1a 100644
--- a/yum/rpmtrans.py
+++ b/yum/rpmtrans.py
@@ -512,11 +512,14 @@ class RPMTransaction:
         for txmbr in txmbrs:
             # "bytes" carries the failed scriptlet tag,
             # "total" carries fatal/non-fatal status
+            scriptlet_name = rpm.tagnames.get(bytes, "<unknown>")
             if total:
-                msg = "Error in %s scriptlet in rpm package %s" % (rpm.tagnames[bytes], txmbr.po)
+                msg = ("Error in %s scriptlet in rpm package %s" %
+                       (scriptlet_name, txmbr.po))
                 txmbr.output_state = TS_FAILED
             else:
-                msg = "Non-fatal %s scriptlet failure in rpm package %s" % (rpm.tagnames[bytes], txmbr.po)
+                msg = ("Non-fatal %s scriptlet failure in rpm package %s" %
+                       (scriptlet_name, txmbr.po))
             self.display.errorlog(msg)
             # FIXME - what else should we do here? raise a failure and abort?
     


More information about the Yum-commits mailing list