Skip to content

Commit a7d8c80

Browse files
committed
fix(resources): SSH+Condor logical issue to get job status that do not exist anymore
1 parent 59423df commit a7d8c80

File tree

1 file changed

+6
-2
lines changed
  • src/DIRAC/Resources/Computing/BatchSystems

1 file changed

+6
-2
lines changed

src/DIRAC/Resources/Computing/BatchSystems/Condor.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,12 @@ def getJobStatus(self, **kwargs):
286286
output, error = sp.communicate()
287287
status = sp.returncode
288288

289-
if status != 0 or not output:
289+
if status != 0:
290290
resultDict["Status"] = status
291291
resultDict["Message"] = error
292292
return resultDict
293+
if not output:
294+
output = "[]"
293295

294296
jobsMetadata = json.loads(output)
295297

@@ -304,10 +306,12 @@ def getJobStatus(self, **kwargs):
304306
output, _ = sp.communicate()
305307
status = sp.returncode
306308

307-
if status != 0 or not output:
309+
if status != 0:
308310
resultDict["Status"] = status
309311
resultDict["Message"] = error
310312
return resultDict
313+
if not output:
314+
output = "[]"
311315

312316
jobsMetadata += json.loads(output)
313317

0 commit comments

Comments
 (0)