[rhmessaging-commits] rhmessaging commits: r2616 - mgmt/trunk/cumin/python/cumin.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Fri Oct 10 09:29:28 EDT 2008


Author: eallen
Date: 2008-10-10 09:29:27 -0400 (Fri, 10 Oct 2008)
New Revision: 2616

Modified:
   mgmt/trunk/cumin/python/cumin/pool.py
Log:
Avoid division by 0 in pool stats when there are no jobs

Modified: mgmt/trunk/cumin/python/cumin/pool.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/pool.py	2008-10-10 13:12:22 UTC (rev 2615)
+++ mgmt/trunk/cumin/python/cumin/pool.py	2008-10-10 13:29:27 UTC (rev 2616)
@@ -315,7 +315,8 @@
             value = jobs
         else:
             value = self.get_value(state)
-        percent = (value*1.0) / (jobs*1.0) * 100.0
+        if jobs:
+            percent = (value*1.0) / (jobs*1.0) * 100.0
         return jobs and "%2.1f" % percent or "-"
     
 




More information about the rhmessaging-commits mailing list