Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/DIRAC/Interfaces/API/DiracAdmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,8 @@ def killPilot(self, gridReference):
:param gridReference: Pilot Job Reference
:return: S_OK,S_ERROR
"""
if not isinstance(gridReference, str):
return self._errorReport("Expected string for pilot reference")
if not isinstance(gridReference, (str, list)):
return self._errorReport("Expected string or list of strings for pilot reference")

result = PilotManagerClient().killPilot(gridReference)
return result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,16 +339,15 @@ def export_getPilots(cls, jobID):
def export_killPilot(cls, pilotRefList):
"""Kill the specified pilots"""
# Make a list if it is not yet
pilotRefs = list(pilotRefList)
if isinstance(pilotRefList, str):
pilotRefs = [pilotRefList]
pilotRefList = [pilotRefList]

# Regroup pilots per site
pilotRefDict = {}
for pilotReference in pilotRefs:
for pilotReference in pilotRefList:
result = cls.pilotAgentsDB.getPilotInfo(pilotReference)
if not result["OK"] or not result["Value"]:
return S_ERROR("Failed to get info for pilot " + pilotReference)
return S_ERROR(f"Failed to get info for pilot {pilotReference}")

pilotDict = result["Value"][pilotReference]
queue = "@@@".join(
Expand Down
Loading