Loading transfer_service/store_preprocessor.py +3 −19 Original line number Diff line number Diff line Loading @@ -103,9 +103,8 @@ class StorePreprocessor(TaskExecutor): [ dirs, files ] = self.systemUtils.scan(self.path) timestamp = datetime.datetime.now().strftime("%Y_%m_%d-%H_%M_%S") # Case 1: /home/user/store contains both files and dirs if files and dirs: self.logger.debug("The 'store' directory contains both files and dirs") # Check if /home/user/store contains files or dirs if files or dirs: destPath = self.path + '/' + timestamp + "-vos_wrapper" os.mkdir(destPath) for file in files: Loading @@ -115,22 +114,7 @@ class StorePreprocessor(TaskExecutor): srcPath = self.path + '/' + dir shutil.move(srcPath, destPath) self.md5calc.recursive(destPath) # Case 2: /home/user/store contains only files elif files and not dirs: self.logger.debug("The 'store' directory contains only files") destPath = self.path + '/' + timestamp + "-vos_wrapper" os.mkdir(destPath) for file in files: srcPath = self.path + '/' + file shutil.move(srcPath, destPath) self.md5calc.recursive(destPath) # Case 3: /home/user/store contains only dirs elif not files and dirs: self.logger.debug("The 'store' directory contains only dirs") for dir in dirs: destPath = self.path + '/' + dir self.md5calc.recursive(destPath) # Case 4: /home/user/store is empty (this should be handled by data_rpc_server.py) # /home/user/store is empty (this should be handled by data_rpc_server.py) else: self.logger.error("FATAL: the 'store' directory is empty.") userInfo = self.systemUtils.userInfo(self.username) Loading Loading
transfer_service/store_preprocessor.py +3 −19 Original line number Diff line number Diff line Loading @@ -103,9 +103,8 @@ class StorePreprocessor(TaskExecutor): [ dirs, files ] = self.systemUtils.scan(self.path) timestamp = datetime.datetime.now().strftime("%Y_%m_%d-%H_%M_%S") # Case 1: /home/user/store contains both files and dirs if files and dirs: self.logger.debug("The 'store' directory contains both files and dirs") # Check if /home/user/store contains files or dirs if files or dirs: destPath = self.path + '/' + timestamp + "-vos_wrapper" os.mkdir(destPath) for file in files: Loading @@ -115,22 +114,7 @@ class StorePreprocessor(TaskExecutor): srcPath = self.path + '/' + dir shutil.move(srcPath, destPath) self.md5calc.recursive(destPath) # Case 2: /home/user/store contains only files elif files and not dirs: self.logger.debug("The 'store' directory contains only files") destPath = self.path + '/' + timestamp + "-vos_wrapper" os.mkdir(destPath) for file in files: srcPath = self.path + '/' + file shutil.move(srcPath, destPath) self.md5calc.recursive(destPath) # Case 3: /home/user/store contains only dirs elif not files and dirs: self.logger.debug("The 'store' directory contains only dirs") for dir in dirs: destPath = self.path + '/' + dir self.md5calc.recursive(destPath) # Case 4: /home/user/store is empty (this should be handled by data_rpc_server.py) # /home/user/store is empty (this should be handled by data_rpc_server.py) else: self.logger.error("FATAL: the 'store' directory is empty.") userInfo = self.systemUtils.userInfo(self.username) Loading