Skip to content

Commit

Permalink
cont
Browse files Browse the repository at this point in the history
  • Loading branch information
chaen committed Feb 7, 2024
1 parent ea613af commit 0138c69
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/DIRAC/DataManagementSystem/Client/FTS3Job.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def __seTokenSupport(seName, vo):
"""
return StorageElement(seName, vo=vo).options.get("TokenSupport", "").lower() in ("true", "yes")

def _constructTransferJob(self, pinTime, allLFNs, target_spacetoken, protocols=None, useToken=False):
def _constructTransferJob(self, pinTime, allLFNs, target_spacetoken, protocols=None, useTokens=False):
"""Build a job for transfer
Some attributes of the job are expected to be set
Expand Down Expand Up @@ -324,7 +324,7 @@ def _constructTransferJob(self, pinTime, allLFNs, target_spacetoken, protocols=N
log = gLogger.getSubLogger(f"constructTransferJob/{self.operationID}/{self.sourceSE}_{self.targetSE}")

isMultiHop = False
useToken = False
useTokens = False

# Check if it is a multiHop transfer
if self.multiHopSE:
Expand Down Expand Up @@ -486,7 +486,7 @@ def _constructTransferJob(self, pinTime, allLFNs, target_spacetoken, protocols=N

# Add tokens if both storages support it and if the requested
if (
useToken
useTokens
and self.__seTokenSupport(hopSrcSEName, self.vo)
and self.__seTokenSupport(hopDstSEName, self.vo)
):
Expand Down Expand Up @@ -515,7 +515,7 @@ def _constructTransferJob(self, pinTime, allLFNs, target_spacetoken, protocols=N
if not res["OK"]:
return res
dstToken = res["Value"]["access_token"]
useToken = True
useTokens = True

# because of an xroot bug (https://github.com/xrootd/xrootd/issues/1433)
# the checksum needs to be lowercase. It does not impact the other
Expand Down Expand Up @@ -548,7 +548,7 @@ def _constructTransferJob(self, pinTime, allLFNs, target_spacetoken, protocols=N
"rmsReqID": self.rmsReqID,
"sourceSE": self.sourceSE,
"targetSE": self.targetSE,
"useToken": useToken,
"useTokens": useTokens,
}

if self.activity:
Expand Down Expand Up @@ -748,7 +748,7 @@ def submit(self, context=None, ftsServer=None, ucert=None, pinTime=36000, protoc

if self.type == "Transfer":
res = self._constructTransferJob(
pinTime, allLFNs, target_spacetoken, protocols=protocols, useToken=bool(fts_access_token)
pinTime, allLFNs, target_spacetoken, protocols=protocols, useTokens=bool(fts_access_token)
)
elif self.type == "Staging":
res = self._constructStagingJob(pinTime, allLFNs, target_spacetoken)
Expand Down

0 comments on commit 0138c69

Please sign in to comment.