Loading transfer_service/checksum.py +4 −1 Original line number Diff line number Diff line Loading @@ -84,5 +84,8 @@ class Checksum(object): else: for file in files: filePath = os.path.abspath(folder) + '/' + file if not os.path.islink(filePath): md5file.write(self.md5sum(filePath) + " ./" + file + '\n') md5file.close() if os.path.exists(md5FilePath) and os.path.getsize(md5FilePath) == 0: os.remove(md5FilePath) transfer_service/data_rpc_server.py +6 −3 Original line number Diff line number Diff line Loading @@ -259,9 +259,12 @@ class DataRPCServer(RedisRPCServer): #path = "/home/" + username + "/store" path = self.storageStorePath.replace("{username}", username) for el in os.listdir(path): try: absPath = path + '/' + el os.chown(absPath, 0, 0) os.chmod(absPath, 0o444) except OSError: self.logger.error(f"Unable to set permissions for '{absPath}', skip.") def run(self): self.logger.info(f"Starting RPC server of type {self.type}...") Loading transfer_service/import_executor.py +7 −3 Original line number Diff line number Diff line Loading @@ -145,8 +145,12 @@ class ImportExecutor(TaskExecutor): dnode.setLocationId(locationId) dnode.setJobId(self.jobId) dnode.setCreatorId(self.userId) if not os.path.islink(file): dnode.setContentLength(os.path.getsize(file)) dnode.setContentMD5(self.md5calc.getMD5(file)) else: dnode.setContentLength(0) dnode.setContentMD5(None) dnode.setAsyncTrans(True) dnode.setSticky(True) try: Loading Loading @@ -250,7 +254,7 @@ class ImportExecutor(TaskExecutor): """ msg += info m.setMessage("VOSpace data storage notification: Job ERROR", msg) m.setMessage("VOSpace import notification: Job ERROR", msg) # Send e-mail notification m.send() except Exception: Loading transfer_service/retrieve_executor.py +1 −1 Original line number Diff line number Diff line Loading @@ -268,7 +268,7 @@ class RetrieveExecutor(TaskExecutor): osRelParentPath += "/" destDirPath = self.storageRetrievePath.replace("{username}", username) + osRelParentPath os.makedirs(destDirPath, exist_ok = True) sp = subprocess.run(["rsync", "-av", srcPath, destDirPath], capture_output = True) sp = subprocess.run(["rsync", "-av", "--no-links", srcPath, destDirPath], capture_output = True) if(sp.returncode or sp.stderr): self.logger.error(f"FATAL: error during the copy process, returnCode = {sp.returncode}, stderr: {sp.stderr}") return False Loading transfer_service/store_executor.py +1 −1 Original line number Diff line number Diff line Loading @@ -116,7 +116,7 @@ class StoreExecutor(TaskExecutor): return False destPathPrefix = storageBasePath + '/' + self.username self.logger.info("Starting data copy...") sp = subprocess.run(["rsync", "-av", srcPathPrefix + '/', destPathPrefix + '/'], capture_output = True) sp = subprocess.run(["rsync", "-av", "--no-links", srcPathPrefix + '/', destPathPrefix + '/'], capture_output = True) if(sp.returncode or sp.stderr): self.logger.error("FATAL: an error occurred while copying the data.") return False Loading Loading
transfer_service/checksum.py +4 −1 Original line number Diff line number Diff line Loading @@ -84,5 +84,8 @@ class Checksum(object): else: for file in files: filePath = os.path.abspath(folder) + '/' + file if not os.path.islink(filePath): md5file.write(self.md5sum(filePath) + " ./" + file + '\n') md5file.close() if os.path.exists(md5FilePath) and os.path.getsize(md5FilePath) == 0: os.remove(md5FilePath)
transfer_service/data_rpc_server.py +6 −3 Original line number Diff line number Diff line Loading @@ -259,9 +259,12 @@ class DataRPCServer(RedisRPCServer): #path = "/home/" + username + "/store" path = self.storageStorePath.replace("{username}", username) for el in os.listdir(path): try: absPath = path + '/' + el os.chown(absPath, 0, 0) os.chmod(absPath, 0o444) except OSError: self.logger.error(f"Unable to set permissions for '{absPath}', skip.") def run(self): self.logger.info(f"Starting RPC server of type {self.type}...") Loading
transfer_service/import_executor.py +7 −3 Original line number Diff line number Diff line Loading @@ -145,8 +145,12 @@ class ImportExecutor(TaskExecutor): dnode.setLocationId(locationId) dnode.setJobId(self.jobId) dnode.setCreatorId(self.userId) if not os.path.islink(file): dnode.setContentLength(os.path.getsize(file)) dnode.setContentMD5(self.md5calc.getMD5(file)) else: dnode.setContentLength(0) dnode.setContentMD5(None) dnode.setAsyncTrans(True) dnode.setSticky(True) try: Loading Loading @@ -250,7 +254,7 @@ class ImportExecutor(TaskExecutor): """ msg += info m.setMessage("VOSpace data storage notification: Job ERROR", msg) m.setMessage("VOSpace import notification: Job ERROR", msg) # Send e-mail notification m.send() except Exception: Loading
transfer_service/retrieve_executor.py +1 −1 Original line number Diff line number Diff line Loading @@ -268,7 +268,7 @@ class RetrieveExecutor(TaskExecutor): osRelParentPath += "/" destDirPath = self.storageRetrievePath.replace("{username}", username) + osRelParentPath os.makedirs(destDirPath, exist_ok = True) sp = subprocess.run(["rsync", "-av", srcPath, destDirPath], capture_output = True) sp = subprocess.run(["rsync", "-av", "--no-links", srcPath, destDirPath], capture_output = True) if(sp.returncode or sp.stderr): self.logger.error(f"FATAL: error during the copy process, returnCode = {sp.returncode}, stderr: {sp.stderr}") return False Loading
transfer_service/store_executor.py +1 −1 Original line number Diff line number Diff line Loading @@ -116,7 +116,7 @@ class StoreExecutor(TaskExecutor): return False destPathPrefix = storageBasePath + '/' + self.username self.logger.info("Starting data copy...") sp = subprocess.run(["rsync", "-av", srcPathPrefix + '/', destPathPrefix + '/'], capture_output = True) sp = subprocess.run(["rsync", "-av", "--no-links", srcPathPrefix + '/', destPathPrefix + '/'], capture_output = True) if(sp.returncode or sp.stderr): self.logger.error("FATAL: an error occurred while copying the data.") return False Loading