Skip to content

Commit

Permalink
Merge pull request #7348 from aldbr/v9.0_REMOVE_valid-arg-setToken
Browse files Browse the repository at this point in the history
[8.0] fix: remove valid arg from setToken
  • Loading branch information
chrisburr authored Dec 7, 2023
2 parents 2d5f57f + 9643f4b commit 512dc8c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/DIRAC/Resources/Computing/AREXComputingElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ def _reset(self):

#############################################################################

def setToken(self, token, valid):
def setToken(self, token):
"""Set the token and update the headers
:param token: OAuth2Token object or dictionary containing token structure
:param int valid: validity period in seconds
"""
super().setToken(token, valid)
super().setToken(token)
self.headers["Authorization"] = "Bearer " + self.token["access_token"]

def _arcIDToJobReference(self, arcJobID):
Expand Down
3 changes: 1 addition & 2 deletions src/DIRAC/Resources/Computing/ComputingElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,8 @@ def setProxy(self, proxy, valid=0):
self.proxy = proxy
self.valid = datetime.datetime.utcnow() + second * valid

def setToken(self, token, valid=0):
def setToken(self, token):
self.token = token
self.valid = datetime.datetime.utcnow() + second * valid

def _prepareProxy(self):
"""Set the environment variable X509_USER_PROXY"""
Expand Down
4 changes: 2 additions & 2 deletions src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def submitPilots(self):
result = self.__getPilotToken(audience=ce.audienceName)
if not result["OK"]:
return result
ce.setToken(result["Value"], 3500)
ce.setToken(result["Value"])

# now really submitting
res = self._submitPilotsToQueue(pilotsToSubmit, ce, queueName)
Expand Down Expand Up @@ -1267,7 +1267,7 @@ def _updatePilotStatusPerQueue(self, queue, proxy):
if not result["OK"]:
self.log.error("Failed to get token", f"{ceName}: {result['Message']}")
return
ce.setToken(result["Value"], 3500)
ce.setToken(result["Value"])

result = ce.getJobStatus(stampedPilotRefs)
if not result["OK"]:
Expand Down

0 comments on commit 512dc8c

Please sign in to comment.