1 |
– |
from crab_logger import Logger |
1 |
|
from crab_exceptions import * |
2 |
|
from crab_util import * |
3 |
|
import common |
57 |
|
try: |
58 |
|
task = common.bossSession.load(1,jobsList) |
59 |
|
except Exception, e : |
60 |
< |
common.logger.debug(3, "Error while getting task : " +str(traceback.format_exc())) |
60 |
> |
common.logger.debug( "Error while getting task : " +str(traceback.format_exc())) |
61 |
|
raise CrabException('Error while getting task '+str(e)) |
62 |
|
return task |
63 |
|
|
68 |
|
try: |
69 |
|
task = common.bossSession.load(1,str(n)) |
70 |
|
except Exception, e : |
71 |
< |
common.logger.debug(3, "Error while getting job : " +str(traceback.format_exc())) |
71 |
> |
common.logger.debug( "Error while getting job : " +str(traceback.format_exc())) |
72 |
|
raise CrabException('Error while getting job '+str(e)) |
73 |
|
return task |
74 |
|
|
80 |
|
""" |
81 |
|
opt={} |
82 |
|
if optsToSave.get('server_mode',0) == 1: opt['serverName']=optsToSave['server_name'] |
83 |
< |
opt['name']=common.work_space.taskName() |
83 |
> |
opt['name']= getUserName()+ '_' + string.split(common.work_space.topDir(),'/')[-2]+'_'+common.work_space.task_uuid() |
84 |
|
task = Task( opt ) |
85 |
|
try: |
86 |
|
common.bossSession.saveTask( task ) |
87 |
|
except Exception, e : |
89 |
– |
# common.logger.debug(3, "Error creating task : " +str(traceback.format_exc())) |
90 |
– |
# raise CrabException('Error creating task '+str(e)) |
88 |
|
raise CrabException('Error creating task '+str(traceback.format_exc())) |
89 |
|
|
90 |
|
return |
208 |
|
CliServerParams(self) |
209 |
|
headerTask= "Task Id = %-40s " %(task['name']) |
210 |
|
displayReport(self,headerTask,lines) |
211 |
< |
commmon.logger.message(showWebMon(self.server_name)) |
211 |
> |
common.logger.info(showWebMon(self.server_name)) |
212 |
|
if (jid ) or (server_mode == 0): |
213 |
|
for job in task.jobs: |
214 |
|
toPrint='' |
257 |
|
try: |
258 |
|
task = common.bossSession.loadJobDist( 1, attr ) |
259 |
|
except Exception, e : |
260 |
< |
common.logger.debug(3, "Error loading Jobs By distinct Attr : " +str(traceback.format_exc())) |
260 |
> |
common.logger.debug( "Error loading Jobs By distinct Attr : " +str(traceback.format_exc())) |
261 |
|
raise CrabException('Error loading Jobs By distinct Attr '+str(e)) |
262 |
|
|
263 |
|
for i in task: distAttr.append(i[attr]) |
271 |
|
try: |
272 |
|
task = common.bossSession.loadJobDistAttr( 1, attr_1, attr_2, list ) |
273 |
|
except Exception, e : |
274 |
< |
common.logger.debug(3, "Error loading Jobs By distinct Attr : " +str(traceback.format_exc())) |
274 |
> |
common.logger.debug( "Error loading Jobs By distinct Attr : " +str(traceback.format_exc())) |
275 |
|
raise CrabException('Error loading Jobs By distinct Attr '+str(e)) |
276 |
|
|
277 |
|
for i in task: distAttr.append(i[attr_1]) |
285 |
|
try: |
286 |
|
task = common.bossSession.loadJobsByAttr(attr ) |
287 |
|
except Exception, e : |
288 |
< |
common.logger.debug(3, "Error loading Jobs By Attr : " +str(traceback.format_exc())) |
288 |
> |
common.logger.debug( "Error loading Jobs By Attr : " +str(traceback.format_exc())) |
289 |
|
raise CrabException('Error loading Jobs By Attr '+str(e)) |
290 |
|
for i in task: |
291 |
|
matched.append(i[field]) |
300 |
|
try: |
301 |
|
task = common.bossSession.loadJobsByRunningAttr(attr) |
302 |
|
except Exception, e : |
303 |
< |
common.logger.debug(3, "Error loading Jobs By Running Attr : " +str(traceback.format_exc())) |
303 |
> |
common.logger.debug( "Error loading Jobs By Running Attr : " +str(traceback.format_exc())) |
304 |
|
raise CrabException('Error loading Jobs By Running Attr '+str(e)) |
305 |
|
for i in task: |
306 |
|
matched.append(i.runningJob[field]) |
334 |
|
rForJ = r |
335 |
|
break |
336 |
|
## Check the submission number and create new running jobs on the client side |
337 |
< |
if rForJ.getAttribute('resubmit') != 'None' and (rForJ.getAttribute('status') not in ['Cleared','Killed','Done','Done (Failed)']) : |
337 |
> |
if rForJ.getAttribute('resubmit') != 'None' and (rForJ.getAttribute('status') not in ['Cleared','Killed','Done','Done (Failed)','Not Submitted', 'Cancelled by user']) : |
338 |
|
if int(job.runningJob['submission']) < int(rForJ.getAttribute('resubmit')) + 1: |
339 |
|
nj_list.append(id) |
340 |
|
if len(nj_list) > 0: self.newRunJobs(nj_list) |
353 |
|
# Data alignment |
354 |
|
if rForJ.getAttribute('status') not in ['Created', 'Unknown']: |
355 |
|
# update the status |
356 |
< |
common.logger.debug(3,"Updating DB status for job: " + str(id) + " @: " \ |
356 |
> |
common.logger.debug("Updating DB status for job: " + str(id) + " @: " \ |
357 |
|
+ str(rForJ.getAttribute('status')) ) |
358 |
|
job.runningJob['statusScheduler'] = str( rForJ.getAttribute('status') ) |
359 |
|
if (rForJ.getAttribute('status') == 'Done' or rForJ.getAttribute('status') == 'Done (Failed)')\ |
375 |
|
|
376 |
|
## unsing 'standardInput' field for 'ended' tag ['Y','N'] |
377 |
|
job['standardInput'] = str( rForJ.getAttribute('ended') ) |
378 |
+ |
|
379 |
+ |
job.runningJob['state'] = str( rForJ.getAttribute('action') ) |
380 |
|
|
381 |
|
#if str( rForJ.getAttribute('resubmit') ).isdigit(): |
382 |
|
# job['submissionNumber'] = int(rForJ.getAttribute('resubmit')) |