9 |
|
def __init__(self, cfg_params, nj_list): |
10 |
|
self.cfg_params = cfg_params |
11 |
|
self.nj_list = nj_list |
12 |
+ |
self.all_jobs=common._db.nJobs('list') |
13 |
|
|
14 |
|
self.fname_base = common.work_space.jobDir() + self.cfg_params['CRAB.jobtype'].upper() + '_' |
15 |
|
|
26 |
|
|
27 |
|
def collectLogging(self): |
28 |
|
for id in self.nj_list: |
29 |
< |
fname = self.fname_base + str(id) + '.LoggingInfo' |
30 |
< |
if os.path.exists(fname): |
30 |
< |
common.logger.message('Logging info for job ' + str(id) + ' already present in '+fname+'\nRemove it for update') |
29 |
> |
if id not in self.all_jobs: |
30 |
> |
common.logger.message('Warning: job # ' + str(id) + ' does not exist! Not possible to ask for postMortem ') |
31 |
|
continue |
32 |
< |
common.scheduler.loggingInfo(id,self.fname_base+str(id)) |
33 |
< |
fl = open(fname, 'r') |
34 |
< |
out = "".join(fl.readlines()) |
35 |
< |
fl.close() |
36 |
< |
reason = self.decodeLogging(out) |
37 |
< |
common.logger.message('Logging info for job '+ str(id) +': '+str(reason)+'\n written to '+str(fname) ) |
32 |
> |
else: |
33 |
> |
fname = self.fname_base + str(id) + '.LoggingInfo' |
34 |
> |
if os.path.exists(fname): |
35 |
> |
common.logger.message('Logging info for job ' + str(id) + ' already present in '+fname+'\nRemove it for update') |
36 |
> |
continue |
37 |
> |
common.scheduler.loggingInfo(id,self.fname_base+str(id)) |
38 |
> |
fl = open(fname, 'r') |
39 |
> |
out = "".join(fl.readlines()) |
40 |
> |
fl.close() |
41 |
> |
reason = self.decodeLogging(out) |
42 |
> |
common.logger.message('Logging info for job '+ str(id) +': '+str(reason)+'\n written to '+str(fname)+' \n' ) |
43 |
|
return |
44 |
|
|
45 |
|
def decodeLogging(self, out): |