Skip to content

Commit 8c0c92c

Browse files
authored
Merge pull request DIRACGrid#8123 from aldbr/main_FIX_pilot-manager-kill-pilots-token
fix: PilotManager not using tokens to kill pilots
2 parents fc2c815 + 263eca7 commit 8c0c92c

1 file changed

Lines changed: 3 additions & 18 deletions

File tree

src/DIRAC/WorkloadManagementSystem/Service/WMSUtilities.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -121,24 +121,9 @@ def killPilotsInQueues(pilotRefDict):
121121
return result
122122
ce = result["Value"]
123123

124-
opsH = Operations(vo=vo)
125-
126-
pilotDN = opsH.getValue("Pilot/GenericPilotDN")
127-
if not pilotDN:
128-
owner = opsH.getValue("Pilot/GenericPilotUser")
129-
res = getDNForUsername(owner)
130-
if not res["OK"]:
131-
return S_ERROR(f"Cannot get the generic pilot DN: {res['Message']}")
132-
pilotDN = res["Value"][0]
133-
134-
pilotGroup = opsH.getValue("Pilot/GenericPilotGroup")
135-
group = getGroupOption(pilotGroup, "VOMSRole")
136-
ret = gProxyManager.getPilotProxyFromVOMSGroup(pilotDN, group)
137-
if not ret["OK"]:
138-
gLogger.error("Could not get proxy:", f"User '{pilotDN}' Group '{group}' : {ret['Message']}")
139-
return S_ERROR("Failed to get the pilot's owner proxy")
140-
proxy = ret["Value"]
141-
ce.setProxy(proxy)
124+
result = setPilotCredentials(ce, pilotDict)
125+
if not result["OK"]:
126+
return result
142127

143128
pilotList = pilotDict["PilotList"]
144129
result = ce.killJob(pilotList)

0 commit comments

Comments
 (0)