Skip to content

Commit a0e77ad

Browse files
panta-123chaen
authored andcommitted
feat (DMS): add diskOnly option to DataManager.getFile
1 parent fd1f120 commit a0e77ad

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
@@ -341,10 +341,14 @@ def getFilesFromDirectory(self, directory, days=0, wildcard="*"):
341341
# These are the data transfer methods
342342
#
343343

344-
def getFile(self, lfn, destinationDir="", sourceSE=None):
345-
"""Get a local copy of a LFN from Storage Elements.
346-
347-
'lfn' is the logical file name for the desired file
344+
def getFile(self, lfn, destinationDir="", sourceSE=None, diskOnly=False):
345+
"""Get local copy of LFN(s) from Storage Elements.
346+
347+
:param mixed lfn: a single LFN or list of LFNs.
348+
:param str destinationDir: directory to which the file(s) will be downnloaded. (Default: current working directory).
349+
:param str sourceSE: source SE from which to download (Default: all replicas will be attempted).
350+
:param bool diskOnly: chooses the disk ONLY replica(s). (Default: False)
351+
:return: S_OK({"Successful": {}, "Failed": {}})/S_ERROR(errMessage).
348352
"""
349353
log = self.log.getSubLogger("getFile")
350354
fileMetadata = {}
@@ -357,7 +361,7 @@ def getFile(self, lfn, destinationDir="", sourceSE=None):
357361
log.debug(errStr)
358362
return S_ERROR(errStr)
359363
log.debug("Attempting to get %s files." % len(lfns))
360-
res = self.getActiveReplicas(lfns, getUrl=False)
364+
res = self.getActiveReplicas(lfns, getUrl=False, diskOnly=diskOnly)
361365
if not res["OK"]:
362366
return res
363367
failed = res["Value"]["Failed"]

0 commit comments

Comments
 (0)