Author: justi9
Date: 2008-12-17 17:22:40 -0500 (Wed, 17 Dec 2008)
New Revision: 3021
Modified:
mgmt/trunk/cumin/python/cumin/job.py
mgmt/trunk/cumin/python/cumin/system.strings
Log:
Scope the systems that appear under the job view
Modified: mgmt/trunk/cumin/python/cumin/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.py 2008-12-17 19:08:18 UTC (rev 3020)
+++ mgmt/trunk/cumin/python/cumin/job.py 2008-12-17 22:22:40 UTC (rev 3021)
@@ -557,10 +557,24 @@
self.__tabs.add_tab(JobAdsViewer(app, "jobads"))
self.__tabs.add_tab(JobOutput(app, "output"))
- self.__tabs.add_tab(SystemSet(app, "systems"))
+ self.__tabs.add_tab(JobSystemSet(app, "systems"))
self.__tabs.add_tab(CuminDetails(app, "details"))
+class JobSystemSet(SystemSet):
+ def get_args(self, session):
+ return self.frame.get_args(session)
+ def render_sql_where(self, session, job):
+ return """
+ where exists
+ (select 1
+ from slot
+ where system = s.node_name and job_id = %(id)s)
+ """
+
+ def get_sql_values(self, session, job):
+ return {"id": job.id}
+
class JobAdsSet(PropertySet):
def __init__(self, app, name):
super(JobAdsSet, self).__init__(app, name, )
Modified: mgmt/trunk/cumin/python/cumin/system.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/system.strings 2008-12-17 19:08:18 UTC (rev 3020)
+++ mgmt/trunk/cumin/python/cumin/system.strings 2008-12-17 22:22:40 UTC (rev 3021)
@@ -8,11 +8,13 @@
c.load_average1_min as load
from sysimage as s
left outer join sysimage_stats as c on c.id = s.stats_curr_id
+{sql_where}
{sql_orderby}
{sql_limit}
[SystemSet.count_sql]
-select count(*) from sysimage
+select count(*) from sysimage as s
+{sql_where}
[SystemSet.html]
<form id="{id}" method="post" action="?">
Show replies by date