Author: eallen
Date: 2010-08-31 11:16:19 -0400 (Tue, 31 Aug 2010)
New Revision: 4247
Modified:
mgmt/newdata/cumin/python/cumin/main.py
Log:
Fix BZ 628605. Now using submission.jobserverRef to get a jobserver and then
jobserver.Pool to get a Collector
Modified: mgmt/newdata/cumin/python/cumin/main.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/main.py 2010-08-30 14:30:15 UTC (rev 4246)
+++ mgmt/newdata/cumin/python/cumin/main.py 2010-08-31 15:16:19 UTC (rev 4247)
@@ -367,21 +367,30 @@
self.adapter.query.add_filter(filter)
filter = SqlComparisonFilter(table._qmf_update_time,
- "now() - interval '60 seconds'",
">=")
+ "now() - interval '600000
seconds'", ">=")
self.adapter.query.add_filter(filter)
+ def get_collector(self, session, submission_id):
+ cls = self.cls
+ submission = cls.get_object_by_id(session.cursor, submission_id)
+
+ cls = self.app.model.com_redhat_grid.JobServer
+ job_server = cls.get_object_by_id(session.cursor,
submission._jobserverRef_id)
+
+ cls = self.app.model.com_redhat_grid.Collector
+ return cls.get_object(session.cursor, Pool=job_server.Pool)
+
class NameColumn(ObjectLinkColumn):
def render_cell_href(self, session, record):
- # XXX fix this when submission has collector ref
- pool = 1
- submission = record[0]
+ submission_id = record[0]
+ collector = self.parent.get_collector(session, submission_id)
+ if collector:
+ branch = session.branch()
+ self.page.main.grid.pool.id.set(session, collector._id)
+ self.page.main.grid.pool.submission.id.set(session, submission_id)
+ self.page.main.grid.pool.submission.view.show(session)
+ return branch.marshal()
- branch = session.branch()
- self.page.main.grid.pool.id.set(session, pool)
- self.page.main.grid.pool.submission.id.set(session, submission)
- self.page.main.grid.pool.submission.view.show(session)
- return branch.marshal()
-
class DurationColumn(TopTableColumn):
def render_header_content(self, session):
return "Duration"
Show replies by date