Author: eallen
Date: 2008-09-30 11:17:23 -0400 (Tue, 30 Sep 2008)
New Revision: 2553
Modified:
mgmt/trunk/cumin/python/cumin/limits.py
Log:
Justin's proposed fix to avoid exception if limits can't be retrieved.
Modified: mgmt/trunk/cumin/python/cumin/limits.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/limits.py 2008-09-30 14:52:48 UTC (rev 2552)
+++ mgmt/trunk/cumin/python/cumin/limits.py 2008-09-30 15:17:23 UTC (rev 2553)
@@ -21,6 +21,8 @@
negotiator = self.get_negotiator(session)
if negotiator:
return self.get_raw_limits(session, negotiator)
+ else:
+ return dict()
def get_negotiator(self, session):
#TODO: find better way to get the negotiator. from pool perhaps?
@@ -90,7 +92,7 @@
if not limits:
limits = self.fetch_limits(session)
self.limits.set(session, limits)
- return len(limits)
+ return limits and len(limits) or 0
class NameColumn(ItemTableColumn):
def render_title(self, session, data):