Skip to content

Commit

Permalink
Merge pull request #7349 from DIRACGridBot/cherry-pick-2-512dc8c2e-in…
Browse files Browse the repository at this point in the history
…tegration

[sweep:integration] fix: remove valid arg from setToken
  • Loading branch information
chrisburr authored Dec 7, 2023
2 parents 15ae418 + 62e2eb7 commit 6752eff
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 @@ -88,13 +88,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 @@ -433,7 +433,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 @@ -1228,7 +1228,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 6752eff

Please sign in to comment.