Skip to content

Commit 512dc8c

Browse files
authored
Merge pull request #7348 from aldbr/v9.0_REMOVE_valid-arg-setToken
[8.0] fix: remove valid arg from setToken
2 parents 2d5f57f + 9643f4b commit 512dc8c

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/DIRAC/Resources/Computing/AREXComputingElement.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ def _reset(self):
9696

9797
#############################################################################
9898

99-
def setToken(self, token, valid):
99+
def setToken(self, token):
100100
"""Set the token and update the headers
101101
102102
:param token: OAuth2Token object or dictionary containing token structure
103103
:param int valid: validity period in seconds
104104
"""
105-
super().setToken(token, valid)
105+
super().setToken(token)
106106
self.headers["Authorization"] = "Bearer " + self.token["access_token"]
107107

108108
def _arcIDToJobReference(self, arcJobID):

src/DIRAC/Resources/Computing/ComputingElement.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,8 @@ def setProxy(self, proxy, valid=0):
102102
self.proxy = proxy
103103
self.valid = datetime.datetime.utcnow() + second * valid
104104

105-
def setToken(self, token, valid=0):
105+
def setToken(self, token):
106106
self.token = token
107-
self.valid = datetime.datetime.utcnow() + second * valid
108107

109108
def _prepareProxy(self):
110109
"""Set the environment variable X509_USER_PROXY"""

src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ def submitPilots(self):
451451
result = self.__getPilotToken(audience=ce.audienceName)
452452
if not result["OK"]:
453453
return result
454-
ce.setToken(result["Value"], 3500)
454+
ce.setToken(result["Value"])
455455

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

12721272
result = ce.getJobStatus(stampedPilotRefs)
12731273
if not result["OK"]:

0 commit comments

Comments
 (0)