Skip to content
Snippets Groups Projects
Commit 6e6d1a18 authored by sveseli's avatar sveseli
Browse files

introduce template replacements for transfers

parent b01a5b55
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,11 @@ class FileProcessor:
@abc.abstractmethod
def processFile(self, fileInfo):
return NotImplemented
def replaceTemplates(self, inputString, fileInfo):
experimentName = fileInfo.get('experimentName', ''):
outputString = inputString.replace('EXPERIMENT_NAME', experimentName)
return outputString
def checkUploadFilesForProcessing(self, filePathsDict, uploadInfo):
return {}
......
......@@ -97,6 +97,8 @@ class GridftpFileTransferPlugin(FileTransferPlugin):
ftpUtility.getMd5Sum(filePath, fileInfo)
# Transfer file
srcUrl = self.replaceTemplates(srcUrl, fileInfo)
destUrl = self.replaceTemplates(destUrl, fileInfo)
self.logger.debug('Starting transfer: %s' % fileInfo)
self.start(srcUrl, destUrl)
......
......@@ -60,6 +60,8 @@ class RsyncFileTransferPlugin(FileTransferPlugin):
FileUtility.getMd5Sum(filePath, fileInfo)
# Transfer file
srcUrl = self.replaceTemplates(srcUrl, fileInfo)
destUrl = self.replaceTemplates(destUrl, fileInfo)
self.logger.debug('Starting transfer: %s' % fileInfo)
self.start(srcUrl, destUrl)
......
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