Skip to content

Commit 3f26305

Browse files
committed
fix: pilotAgentsDB.deletePilot requires a pilotref
1 parent 363c1f3 commit 3f26305

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/DIRAC/WorkloadManagementSystem/Service/JobManagerHandler.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -444,12 +444,10 @@ def __deleteJob(self, jobID):
444444
:param int jobID: job ID
445445
:return: S_OK()/S_ERROR()
446446
"""
447-
result = self.jobDB.setJobStatus(jobID, JobStatus.DELETED, "Checking accounting")
448-
if not result["OK"]:
447+
if not (result := self.jobDB.setJobStatus(jobID, JobStatus.DELETED, "Checking accounting"))["OK"]:
449448
return result
450449

451-
result = self.taskQueueDB.deleteJob(jobID)
452-
if not result["OK"]:
450+
if not (result := self.taskQueueDB.deleteJob(jobID))["OK"]:
453451
self.log.warn("Failed to delete job from the TaskQueue")
454452

455453
# if it was the last job for the pilot
@@ -467,8 +465,7 @@ def __deleteJob(self, jobID):
467465
if not result["OK"]:
468466
self.log.error("Failed to get pilot info", result["Message"])
469467
return result
470-
pilotRef = result[0]["PilotJobReference"]
471-
ret = self.pilotAgentsDB.deletePilot(pilot)
468+
ret = self.pilotAgentsDB.deletePilot(result["Value"]["PilotJobReference"])
472469
if not ret["OK"]:
473470
self.log.error("Failed to delete pilot from PilotAgentsDB", ret["Message"])
474471
return ret

0 commit comments

Comments
 (0)