Skip to content
Snippets Groups Projects
Commit 3b06cd3c authored by sveseli's avatar sveseli
Browse files

gridftp plugin fixes

parent 0712b9cc
No related branches found
No related tags found
No related merge requests found
__version__ = "0.8 (2016.02.05)"
__version__ = "0.9 (2016.02.24)"
......@@ -13,6 +13,7 @@ from dm.ds_web_service.api.dsRestApiFactory import DsRestApiFactory
class GridftpFileTransferPlugin(FileTransferPlugin):
DEFAULT_COMMAND = 'globus-url-copy -c -cd -r -vb -tcp-bs 512K -p 1 -sync -sync-level 2'
DIRECTORY_TRANSFER_COMMAND = 'globus-url-copy -c -cd -r -vb -tcp-bs 512K -p 5 -sync -sync-level 2'
DEFAULT_PORT = 2811
......@@ -107,7 +108,7 @@ class GridftpFileTransferPlugin(FileTransferPlugin):
# Transfer file
self.logger.debug('Starting transfer: %s -> %s' % (srcUrl, destUrl))
self.start(src=srcUrl, dest=destUrl, templateInfo=fileInfo, cwd=dataDirectory)
self.start(src=srcUrl, dest=destUrl, templateInfo=fileInfo)
# Get remote checksum
if self.remoteMd5Sum:
......@@ -141,12 +142,10 @@ class GridftpFileTransferPlugin(FileTransferPlugin):
return srcUrl
def getDestDirUrl(self, dataDirectory, storageHost, storageDirectory):
(scheme, host, port, dirPath) = FtpUtility.parseFtpUrl(dataDirectory, defaultPort=self.DEFAULT_PORT)
dirName = os.path.dirname(os.path.relpath(dataDirectory, dirPath)).strip()
if self.dest:
destUrl = '%s/%s/' % (self.dest, dirPath)
destUrl = '%s/' % (self.dest)
else:
destUrl = 'sshftp://%s/%s/%s/' % (storageHost, storageDirectory, dirName)
destUrl = 'sshftp://%s/%s/' % (storageHost, storageDirectory)
return destUrl
def processDirectory(self, directoryInfo):
......@@ -161,7 +160,7 @@ class GridftpFileTransferPlugin(FileTransferPlugin):
# Transfer directory
self.logger.debug('Starting transfer: %s -> %s' % (srcUrl, destUrl))
self.start(src=srcUrl, dest=destUrl, templateInfo=uploadInfo, cwd=dataDirectory)
self.start(src=srcUrl, dest=destUrl, command=self.DIRECTORY_TRANSFER_COMMAND, templateInfo=uploadInfo)
#######################################################################
# Testing.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment