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

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Fri Oct 31 12:56:15 EDT 2008


Author: eallen
Date: 2008-10-31 12:56:15 -0400 (Fri, 31 Oct 2008)
New Revision: 2716

Modified:
   mgmt/trunk/cumin/python/cumin/system.py
Log:
Filter Grid Jobs by system by joining job.scheduler.system to system.nodeName

Modified: mgmt/trunk/cumin/python/cumin/system.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/system.py	2008-10-31 14:20:20 UTC (rev 2715)
+++ mgmt/trunk/cumin/python/cumin/system.py	2008-10-31 16:56:15 UTC (rev 2716)
@@ -80,6 +80,14 @@
     
         def render_contents(self, session, count, slot):
             return ""
+        
+        def render_href(self, session, count, slot):
+            branch = session.branch()
+            try:
+                job = Job.select("custom_id = '%s'" % slot.JobId)[0]
+            except Exception, e:
+                return "#"
+            return self.page.main.pool.job.get_href(branch, job)
 
         def render_cell_id(self, session, count, slot):
             return "%i" % slot.sourceObjectId
@@ -121,15 +129,17 @@
 from job import JobTab
 
 class SystemJobSet(JobTab):
-    def render_title(self, session, *args):
-        sql = "1 = 1" # XXX
-        return "Grid Jobs %s" % fmt_count(Job.select(sql).count())
+    def render_title(self, session, system):
+        return "Grid Jobs %s" % fmt_count(self.get_item_count(session, system))
 
-    def render_sql_where(self, session, *args):
+    def render_sql_where(self, session, system):
         phase_sql = self.get_phase_sql(session)
-        sql = "1 = 1" # XXX
+        sql = "s.system = %(nodeName)s"
         return "where %s" % " and ".join([phase_sql, sql])
 
+    def get_sql_values(self, session, system):
+        return {"nodeName": system.nodeName}
+        
 from slot import SlotSet
 
 class SystemSlotSet(SlotSet):




More information about the rhmessaging-commits mailing list