Skip to content
Snippets Groups Projects
Commit 17dafaa1 authored by sveseli's avatar sveseli
Browse files

fix for filenames that have columns, as well as those that start with a dash

parent b2ccd4df
No related branches found
No related tags found
No related merge requests found
......@@ -34,15 +34,15 @@ class FileTransferPlugin(FileProcessor):
self.start(src=srcUrl, dest=destUrl, templateInfo=fileInfo)
def getSrcUrl(self, filePath, dataDirectory):
# Use relative path with respect to data directory as a source
srcUrl = os.path.relpath(filePath, dataDirectory)
return srcUrl
return filePath
def getDestUrl(self, filePath, dataDirectory, storageHost, storageDirectory):
# Use relative path with respect to data directory as a source
srcUrl = os.path.relpath(filePath, dataDirectory)
if self.dest:
destUrl = '%s' % (self.dest)
destUrl = '%s/%s' % (self.dest, srcUrl)
else:
destUrl = '%s:%s' % (storageHost, storageDirectory)
destUrl = '%s:%s/%s' % (storageHost, storageDirectory, srcUrl)
return destUrl
def getSrcDirUrl(self, dataDirectory):
......
......@@ -11,9 +11,9 @@ from dm.ds_web_service.api.dsRestApiFactory import DsRestApiFactory
class RsyncFileTransferPlugin(FileTransferPlugin):
DEFAULT_COMMAND = 'rsync -arvlPR'
DIRECTORY_TRANSFER_COMMAND = 'rsync -arvlP'
DRY_RUN_COMMAND = 'rsync -arvlP'
DEFAULT_COMMAND = 'rsync -arvlPR --'
DIRECTORY_TRANSFER_COMMAND = 'rsync -arvlP --'
DRY_RUN_COMMAND = 'rsync -arvlP --dry-run --'
def __init__(self, src=None, dest=None, command=DEFAULT_COMMAND, localMd5Sum=True, remoteMd5Sum=False, deleteOriginal=False, pluginMustProcessFiles=True, dependsOn=[]):
FileTransferPlugin.__init__(self, command, src, dest, dependsOn=dependsOn)
......@@ -29,7 +29,7 @@ class RsyncFileTransferPlugin(FileTransferPlugin):
storageDirectory = uploadInfo['storageDirectory']
storageHost = uploadInfo['storageHost']
dataDirectory = uploadInfo['dataDirectory']
dryRunCommand = '%s --dry-run %s/ %s:%s' % (self.DRY_RUN_COMMAND, dataDirectory, storageHost, storageDirectory)
dryRunCommand = '%s %s/ %s:%s' % (self.DRY_RUN_COMMAND, dataDirectory, storageHost, storageDirectory)
subprocess = DmSubprocess.getSubprocess(dryRunCommand)
subprocess.run()
lines = subprocess.getStdOut().split('\n')
......
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