[rhmessaging-commits] rhmessaging commits: r1682 - mgmt/cumin/python/cumin.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Mon Feb 11 14:36:05 EST 2008


Author: justi9
Date: 2008-02-11 14:36:05 -0500 (Mon, 11 Feb 2008)
New Revision: 1682

Modified:
   mgmt/cumin/python/cumin/test.py
Log:
Make sure exceptions have a message attr before trying to print it.



Modified: mgmt/cumin/python/cumin/test.py
===================================================================
--- mgmt/cumin/python/cumin/test.py	2008-02-11 19:06:55 UTC (rev 1681)
+++ mgmt/cumin/python/cumin/test.py	2008-02-11 19:36:05 UTC (rev 1682)
@@ -159,6 +159,14 @@
 
     def report(self, writer, depth):
         entry = ("  " * depth) + str(self.test)
+        status = "-"
+
+        if self.exception:
+            status = self.exception.__class__.__name__
+
+            if hasattr(self.exception, "message"):
+                status = status + ": " + self.exception.message
+
         status = self.exception and self.exception.message or "-"
 
         writer.write("%-40s %s" % (entry, status))




More information about the rhmessaging-commits mailing list