Author: eallen
Date: 2012-11-26 21:48:16 +0000 (Mon, 26 Nov 2012)
New Revision: 5554
Modified:
trunk/cumin/python/cumin/messaging/queue.py
Log:
Bug 872218 - Messaging:Queue:Journal key error. Fix for queue journal stats list.
Modified: trunk/cumin/python/cumin/messaging/queue.py
===================================================================
--- trunk/cumin/python/cumin/messaging/queue.py 2012-11-20 17:44:29 UTC (rev 5553)
+++ trunk/cumin/python/cumin/messaging/queue.py 2012-11-26 21:48:16 UTC (rev 5554)
@@ -493,7 +493,7 @@
self.add_attribute(self.journal)
self.attrs = ("initialFileCount", "dataFileSize",
- "recordDepth", "recordEnqueues",
+ "recordDepth", "enqueues",
"outstandingAIOs", "freeFileCount",
"availableFileCount", "writeWaitFailures",
"writeBusyFailures", "readRecordCount",
@@ -505,11 +505,10 @@
queue = self.widget.object.get(session)
cls = self.app.model.com_redhat_rhm_store.Journal
- journals = cls.get_selection(session.cursor,
+ journal = cls.get_object(session.cursor,
_queueRef_id=queue._id)
+ return journal
- return len(journals)
-
def render_title(self, session):
return "Journal"
@@ -521,6 +520,25 @@
else:
return "<div class=\"iblock\">%s</div>" %
fmt_none()
+ def do_get_items(self, session):
+ """ override do_get_items since the object is actually the journal
attr
+ and the attr list is mixed stats and props """
+
+ object = self.journal.get(session)
+ if not object:
+ return []
+
+ stats = list()
+ for field in self.get_fields(session):
+ # Some of the entries in the attrs list are properties and not statistics
+ if field in object._class._statistics_by_name:
+ cls = object._class._statistics_by_name[field]
+ else:
+ cls = object._class._properties_by_name[field]
+
+ stats.append((cls, getattr(object, cls.name, None)))
+ return stats
+
class QueueTxnStatSet(StatSet):
def __init__(self, app, name, queue):
super(QueueTxnStatSet, self).__init__(app, name, queue)
Show replies by date