Author: eallen
Date: 2008-09-19 19:49:54 -0400 (Fri, 19 Sep 2008)
New Revision: 2508
Modified:
mgmt/trunk/cumin/python/cumin/job.py
Log:
Made call to Fetch
Removed last partial line returned from Fetch because of non-ascii junk characters
Modified: mgmt/trunk/cumin/python/cumin/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.py 2008-09-19 21:46:52 UTC (rev 2507)
+++ mgmt/trunk/cumin/python/cumin/job.py 2008-09-19 23:49:54 UTC (rev 2508)
@@ -347,10 +347,11 @@
def do_process(self, session, *args):
self.show_column(session, "global_job_id")
+ self.show_column(session, "custom_id")
self.show_column(session, "cmd")
- #self.show_column(session, "submitter")
+ self.show_column(session, "scheduler")
+ self.show_column(session, "submitter")
self.show_column(session, "job_status")
- self.show_column(session, "scheduler")
super(JobGroupJobSet, self).do_process(session, *args)
def render_title(self, session, group):
@@ -763,26 +764,43 @@
def completion(status, job_output):
if "Data" in job_output:
- self.job_output = job_output["Data"]
+ raw = job_output["Data"]
+ self.job_output = fix_raw(raw)
self.got_data = True
def predicate():
return self.got_data
+ def fix_raw(raw):
+ """ remove the last partial line from the buffer
+
+ This is done because the buffer ends with non-ascii junk characters
+ """
+ lindex = -1
+ ord_nl = ord('\n')
+ while ord(raw[-lindex:][0]) != ord_nl:
+ lindex = lindex + 1
+ return raw[:-lindex]
+
first_last = self.first_last.get(session)
- start = first_last == "t" and -1024 or 0
- end = first_last == "t" and 0 or 1024
+ start = 0
+ end = 2048
+ #start = first_last == "t" and -10240 or 0
+ #end = first_last == "t" and 0 or 10240
file = self.which_file.get_current_file_name(session)
if file:
try:
model = self.app.model
job = args[0]
- job.Fetch(model.data, completion, file, start, end)
+ data = dict()
+ job.Fetch(model.data, completion, file, start, end, data)
# wait for up to 20 seconds for completion to be called
wait(predicate, timeout=20)
+ if not self.got_data:
+ self.job_output = "Unable to get file at %s. Reason: time
out" % file
except Exception, e:
- #self.job_output = "Unable to get file at %s. Reason: %s" %
(file, e)
- self.job_output = self.get_fake_output()
+ self.job_output = "Unable to get file at %s. Reason: %s" %
(file, e)
+ #self.job_output = self.get_fake_output()
return self.job_output and escape_entity(self.job_output)
Show replies by date