@@ -261,7 +261,7 @@ def cancel(self, proj_dir, job_ids=None, proxy=None, instance=None, myproxy_user
261
261
return {job_id : None for job_id in job_ids }
262
262
263
263
def cleanup (self , proj_dir , job_ids = None , proxy = None , instance = None , myproxy_username = None ,
264
- silent = False ):
264
+ silent = False , _processes = None ):
265
265
if job_ids is None :
266
266
job_ids = self ._job_ids_from_proj_dir (proj_dir )
267
267
@@ -363,24 +363,32 @@ def extra(job_id, job_data=None):
363
363
extra ["tracking_url" ] = monitoring_url
364
364
return extra
365
365
366
- # in case scheduler status or the json line is missing, the submission could be too new
366
+ # in case scheduler status or the json line is missing, the submission could be too new or
367
+ # it failed entirely
367
368
if not scheduler_status or not json_line :
368
- accepted_server_states = [
369
+ pending_server_states = {
369
370
"HOLDING on command SUBMIT" ,
370
371
"NEW on command SUBMIT" ,
371
372
"QUEUED on command SUBMIT" ,
372
373
"WAITING on command SUBMIT" ,
373
374
"SUBMITTED" ,
374
- ]
375
- if server_status not in accepted_server_states :
376
- s = "," .join (map ("'{}'" .format , accepted_server_states ))
375
+ }
376
+ failed_server_states = {"SUBMITFAILED" }
377
+ error = None
378
+ if server_status in pending_server_states :
379
+ status = cls .PENDING
380
+ elif server_status in failed_server_states :
381
+ status = cls .FAILED
382
+ error = "submission failed"
383
+ else :
384
+ s = "," .join (map ("'{}'" .format , pending_server_states | failed_server_states ))
377
385
raise Exception (
378
386
"no per-job information available (yet?), which is only accepted if the crab " +
379
387
"server status is any of {}, but got '{}'" .format (s , server_status ),
380
388
)
381
- # interpret all jobs as pending
382
389
return {
383
- job_id : cls .job_status_dict (job_id = job_id , status = cls .PENDING , extra = extra (job_id ))
390
+ job_id : cls .job_status_dict (job_id = job_id , status = status , error = error ,
391
+ extra = extra (job_id ))
384
392
for job_id in job_ids
385
393
}
386
394
0 commit comments