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

merged fixes from 0.9

parents e370f2d4 15625ef1
No related branches found
No related tags found
No related merge requests found
...@@ -15,5 +15,5 @@ DM_DAQ_WEB_SERVICE_HOST=DM_HOSTNAME ...@@ -15,5 +15,5 @@ DM_DAQ_WEB_SERVICE_HOST=DM_HOSTNAME
DM_DAQ_WEB_SERVICE_PORT=33336 DM_DAQ_WEB_SERVICE_PORT=33336
DM_CAT_WEB_SERVICE_HOST=DM_HOSTNAME DM_CAT_WEB_SERVICE_HOST=DM_HOSTNAME
DM_CAT_WEB_SERVICE_PORT=44436 DM_CAT_WEB_SERVICE_PORT=44436
DM_SOFTWARE_VERSION="0.8 (DM_DATE)" DM_SOFTWARE_VERSION="0.9 (DM_DATE)"
__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 ...@@ -13,6 +13,7 @@ from dm.ds_web_service.api.dsRestApiFactory import DsRestApiFactory
class GridftpFileTransferPlugin(FileTransferPlugin): class GridftpFileTransferPlugin(FileTransferPlugin):
DEFAULT_COMMAND = 'globus-url-copy -c -cd -r -vb -tcp-bs 512K -p 1 -sync -sync-level 2' 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 DEFAULT_PORT = 2811
...@@ -107,7 +108,7 @@ class GridftpFileTransferPlugin(FileTransferPlugin): ...@@ -107,7 +108,7 @@ class GridftpFileTransferPlugin(FileTransferPlugin):
# Transfer file # Transfer file
self.logger.debug('Starting transfer: %s -> %s' % (srcUrl, destUrl)) 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 # Get remote checksum
if self.remoteMd5Sum: if self.remoteMd5Sum:
...@@ -141,12 +142,10 @@ class GridftpFileTransferPlugin(FileTransferPlugin): ...@@ -141,12 +142,10 @@ class GridftpFileTransferPlugin(FileTransferPlugin):
return srcUrl return srcUrl
def getDestDirUrl(self, dataDirectory, storageHost, storageDirectory): 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: if self.dest:
destUrl = '%s/%s/' % (self.dest, dirPath) destUrl = '%s/' % (self.dest)
else: else:
destUrl = 'sshftp://%s/%s/%s/' % (storageHost, storageDirectory, dirName) destUrl = 'sshftp://%s/%s/' % (storageHost, storageDirectory)
return destUrl return destUrl
def processDirectory(self, directoryInfo): def processDirectory(self, directoryInfo):
...@@ -161,7 +160,7 @@ class GridftpFileTransferPlugin(FileTransferPlugin): ...@@ -161,7 +160,7 @@ class GridftpFileTransferPlugin(FileTransferPlugin):
# Transfer directory # Transfer directory
self.logger.debug('Starting transfer: %s -> %s' % (srcUrl, destUrl)) 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. # Testing.
......
...@@ -231,8 +231,8 @@ class ExperimentManager(Singleton): ...@@ -231,8 +231,8 @@ class ExperimentManager(Singleton):
if os.path.exists(directoryPath): if os.path.exists(directoryPath):
self.logger.debug('Processing directory path %s (directoryInfo: %s)' % (directoryPath, directoryInfo)) self.logger.debug('Processing directory path %s (directoryInfo: %s)' % (directoryPath, directoryInfo))
if self.manageStoragePermissions: if self.manageStoragePermissions:
self.logger.debug('Modifying permissions for directory %s' % directoryPath) self.logger.debug('Modifying permissions for directory %s to %s' % (directoryPath, self.DIR_PERMISSIONS_MODE))
OsUtility.chmodPath(directoryPath, fileMode=self.FILE_PERMISSIONS_MODE) OsUtility.chmodPath(directoryPath, dirMode=self.DIR_PERMISSIONS_MODE)
self.logger.debug('Changing group owner for %s to %s' % (directoryPath, experimentName)) self.logger.debug('Changing group owner for %s to %s' % (directoryPath, experimentName))
self.platformUtility.recursivelyChangePathGroupOwner(directoryPath, experimentName) self.platformUtility.recursivelyChangePathGroupOwner(directoryPath, experimentName)
# Recursively modify subdirectory permissions # Recursively modify subdirectory permissions
......
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