@@ -232,6 +232,7 @@ def _getDelegationID(self, arcJobID):
232
232
:param str jobID: ARC job ID
233
233
:return: delegation ID
234
234
"""
235
+ params = {"action" : "delegations" }
235
236
query = self ._urlJoin ("jobs" )
236
237
237
238
# Submit the POST request to get the delegation
@@ -240,6 +241,7 @@ def _getDelegationID(self, arcJobID):
240
241
query ,
241
242
data = json .dumps (jobsJson ),
242
243
headers = self .headers ,
244
+ params = params ,
243
245
timeout = self .arcRESTTimeout ,
244
246
)
245
247
@@ -253,8 +255,11 @@ def _getDelegationID(self, arcJobID):
253
255
if "delegation_id" not in responseDelegation ["job" ]:
254
256
return S_ERROR ("Cannot find the Delegation ID for Job %s" % arcJobID )
255
257
256
- delegationID = responseDelegation ["job" ]["delegation_id" ][0 ]
257
- return S_OK (delegationID )
258
+ delegationIDs = responseDelegation ["job" ]["delegation_id" ]
259
+ # Documentation says "Array", but a single string is returned if there is only one
260
+ if not isinstance (delegationIDs , list ):
261
+ delegationIDs = [delegationIDs ]
262
+ return S_OK (delegationIDs [0 ])
258
263
259
264
#############################################################################
260
265
@@ -538,7 +543,10 @@ def _renewJobs(self, arcJobList):
538
543
if not res ["OK" ]:
539
544
continue
540
545
541
- timeLeft = proxy .getRemainingSecs ()
546
+ timeLeftRes = proxy .getRemainingSecs ()
547
+ if not timeLeftRes ["OK" ]:
548
+ continue
549
+ timeLeft = timeLeftRes ["Value" ]
542
550
if timeLeft < self .proxyTimeLeftBeforeRenewal :
543
551
self .log .debug (
544
552
"Renewing proxy for job" ,
0 commit comments