Author: eallen
Date: 2008-09-23 12:48:12 -0400 (Tue, 23 Sep 2008)
New Revision: 2530
Modified:
mgmt/trunk/cumin/python/cumin/model.py
Log:
Added Submitter to Job summary properties
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-09-22 19:50:13 UTC (rev 2529)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-09-23 16:48:12 UTC (rev 2530)
@@ -1699,9 +1699,10 @@
prop.summary = True
prop.escape = False
- #prop = self.SubmitterProperty(self, "Owner")
- #prop.title = "Submitter"
- #prop.summary = True
+ prop = self.SubmitterProperty(self, "submitter")
+ prop.title = "Submitter"
+ prop.summary = True
+ prop.escape = False
prop = CuminProperty(self, "Args")
prop.title = "Args"
@@ -1784,11 +1785,18 @@
class SubmitterProperty(CuminProperty):
def value(self, session, job):
- submitter = super(CuminJob.SubmitterProperty, self).value(session, job)
branch = session.branch()
frame = self.cumin_class.get_pool_frame(branch)
- frame.show_submitter(branch, submitter)
- return submitter and escape_amp(fmt_olink(branch, submitter,
name=submitter.Name))
+ try:
+ submitter = job.submitter
+ frame.show_submitter(branch, submitter)
+ except:
+ submitter = job
+ submitter.Name = "Unavailable"
+ frame.show_job(branch, job)
+
+ return escape_amp(fmt_olink(branch, submitter, name=submitter.Name))
+
class SchedulerProperty(CuminProperty):
def value(self, session, job):
Show replies by date