@@ -306,10 +306,14 @@ def getFilesFromDirectory(self, directory, days=0, wildcard="*"):
306
306
# These are the data transfer methods
307
307
#
308
308
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).
313
317
"""
314
318
log = self .log .getSubLogger ("getFile" )
315
319
fileMetadata = {}
@@ -322,7 +326,7 @@ def getFile(self, lfn, destinationDir="", sourceSE=None):
322
326
log .debug (errStr )
323
327
return S_ERROR (errStr )
324
328
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 )
326
330
if not res ["OK" ]:
327
331
return res
328
332
failed = res ["Value" ]["Failed" ]
0 commit comments