Skip to content

Commit afb6a45

Browse files
authored
Merge pull request #6759 from DIRACGridBot/cherry-pick-2-0c48acfd6-integration
[sweep:integration] Add diskOnly option to getFile
2 parents 6690dcf + b3c2cda commit afb6a45

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/DIRAC/DataManagementSystem/Client/DataManager.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,14 @@ def getFilesFromDirectory(self, directory, days=0, wildcard="*"):
306306
# These are the data transfer methods
307307
#
308308

309-
def getFile(self, lfn, destinationDir="", sourceSE=None):
310-
"""Get a local copy of a LFN from Storage Elements.
311-
312-
'lfn' is the logical file name for the desired file
309+
def getFile(self, lfn, destinationDir="", sourceSE=None, diskOnly=False):
310+
"""Get local copy of LFN(s) from Storage Elements.
311+
312+
:param mixed lfn: a single LFN or list of LFNs.
313+
:param str destinationDir: directory to which the file(s) will be downnloaded. (Default: current working directory).
314+
:param str sourceSE: source SE from which to download (Default: all replicas will be attempted).
315+
:param bool diskOnly: chooses the disk ONLY replica(s). (Default: False)
316+
:return: S_OK({"Successful": {}, "Failed": {}})/S_ERROR(errMessage).
313317
"""
314318
log = self.log.getSubLogger("getFile")
315319
fileMetadata = {}
@@ -322,7 +326,7 @@ def getFile(self, lfn, destinationDir="", sourceSE=None):
322326
log.debug(errStr)
323327
return S_ERROR(errStr)
324328
log.debug("Attempting to get %s files." % len(lfns))
325-
res = self.getActiveReplicas(lfns, getUrl=False)
329+
res = self.getActiveReplicas(lfns, getUrl=False, diskOnly=diskOnly)
326330
if not res["OK"]:
327331
return res
328332
failed = res["Value"]["Failed"]

0 commit comments

Comments
 (0)