Loading transfer_service/store_preprocessor.py +9 −17 Original line number Diff line number Diff line Loading @@ -32,11 +32,8 @@ class StorePreprocessor(Preprocessor): self.params["host"], self.params.getint("port"), self.params["db"]) self.storageBasePaths = dict() self.params = config.loadSection("tape_library") self.storageBasePaths["tape"] = self.params["base_path"] self.params = config.loadSection("ia2_server") self.storageBasePaths["server"] = self.params["base_path"] self.params = config.loadSection("transfer_node") self.storageBasePath = self.params["base_path"] self.jobObj = None self.dbConn.connect() super(StorePreprocessor, self).__init__() Loading Loading @@ -137,12 +134,9 @@ class StorePreprocessor(Preprocessor): out = open("log.txt", "w") for dir in dirs: out.write(f"DIR: {dir}\n") if self.jobObj["jobInfo"]["requestType"] == "HSTORE": pathPrefix = self.storageBasePaths["tape"].replace("{username}", self.jobObj["jobInfo"]["userName"]) elif self.jobObj["jobInfo"]["requestType"] == "CSTORE": pathPrefix = self.storageBasePaths["server"].replace("{username}", self.jobObj["jobInfo"]["userName"]) pathPrefix = self.storageBasePath.replace("{username}", self.username) out.write(f"pathPrefix: {pathPrefix}\n") basePath = os.path.dirname(dir).replace(pathPrefix, "/" + self.jobObj["jobInfo"]["userName"]) basePath = os.path.dirname(dir).replace(pathPrefix, "/" + self.username) out.write(f"basePath: {basePath}\n") cnode = Node(os.path.basename(dir), "container"); cnode.setParentPath(basePath) Loading @@ -154,12 +148,9 @@ class StorePreprocessor(Preprocessor): for file in flist: out.write(f"FILE: {file}\n") if self.md5calc.fileIsValid(file): if self.jobObj["jobInfo"]["requestType"] == "HSTORE": pathPrefix = self.storageBasePaths["tape"].replace("{username}", self.jobObj["jobInfo"]["userName"]) elif self.jobObj["jobInfo"]["requestType"] == "CSTORE": pathPrefix = self.storageBasePaths["server"].replace("{username}", self.jobObj["jobInfo"]["userName"]) pathPrefix = self.storageBasePath.replace("{username}", self.username) out.write(f"pathPrefix: {pathPrefix}\n") basePath = os.path.dirname(file).replace(pathPrefix, "/" + self.jobObj["jobInfo"]["userName"]) basePath = os.path.dirname(file).replace(pathPrefix, "/" + self.username) out.write(f"basePath: {basePath}\n") dnode = Node(os.path.basename(file), "data") dnode.setParentPath(basePath) Loading @@ -175,7 +166,8 @@ class StorePreprocessor(Preprocessor): while True: if(self.readyQueue.len() <= self.maxReadyJobs and self.pendingQueue.len() > 0): self.jobObj = self.pendingQueue.getJob() self.prepare(self.jobObj["jobInfo"]["userName"]) self.username = self.jobObj["jobInfo"]["userName"] self.prepare(self.username) self.execute() self.pendingQueue.moveJobTo("ready") print("Job MOVED!") Loading Loading
transfer_service/store_preprocessor.py +9 −17 Original line number Diff line number Diff line Loading @@ -32,11 +32,8 @@ class StorePreprocessor(Preprocessor): self.params["host"], self.params.getint("port"), self.params["db"]) self.storageBasePaths = dict() self.params = config.loadSection("tape_library") self.storageBasePaths["tape"] = self.params["base_path"] self.params = config.loadSection("ia2_server") self.storageBasePaths["server"] = self.params["base_path"] self.params = config.loadSection("transfer_node") self.storageBasePath = self.params["base_path"] self.jobObj = None self.dbConn.connect() super(StorePreprocessor, self).__init__() Loading Loading @@ -137,12 +134,9 @@ class StorePreprocessor(Preprocessor): out = open("log.txt", "w") for dir in dirs: out.write(f"DIR: {dir}\n") if self.jobObj["jobInfo"]["requestType"] == "HSTORE": pathPrefix = self.storageBasePaths["tape"].replace("{username}", self.jobObj["jobInfo"]["userName"]) elif self.jobObj["jobInfo"]["requestType"] == "CSTORE": pathPrefix = self.storageBasePaths["server"].replace("{username}", self.jobObj["jobInfo"]["userName"]) pathPrefix = self.storageBasePath.replace("{username}", self.username) out.write(f"pathPrefix: {pathPrefix}\n") basePath = os.path.dirname(dir).replace(pathPrefix, "/" + self.jobObj["jobInfo"]["userName"]) basePath = os.path.dirname(dir).replace(pathPrefix, "/" + self.username) out.write(f"basePath: {basePath}\n") cnode = Node(os.path.basename(dir), "container"); cnode.setParentPath(basePath) Loading @@ -154,12 +148,9 @@ class StorePreprocessor(Preprocessor): for file in flist: out.write(f"FILE: {file}\n") if self.md5calc.fileIsValid(file): if self.jobObj["jobInfo"]["requestType"] == "HSTORE": pathPrefix = self.storageBasePaths["tape"].replace("{username}", self.jobObj["jobInfo"]["userName"]) elif self.jobObj["jobInfo"]["requestType"] == "CSTORE": pathPrefix = self.storageBasePaths["server"].replace("{username}", self.jobObj["jobInfo"]["userName"]) pathPrefix = self.storageBasePath.replace("{username}", self.username) out.write(f"pathPrefix: {pathPrefix}\n") basePath = os.path.dirname(file).replace(pathPrefix, "/" + self.jobObj["jobInfo"]["userName"]) basePath = os.path.dirname(file).replace(pathPrefix, "/" + self.username) out.write(f"basePath: {basePath}\n") dnode = Node(os.path.basename(file), "data") dnode.setParentPath(basePath) Loading @@ -175,7 +166,8 @@ class StorePreprocessor(Preprocessor): while True: if(self.readyQueue.len() <= self.maxReadyJobs and self.pendingQueue.len() > 0): self.jobObj = self.pendingQueue.getJob() self.prepare(self.jobObj["jobInfo"]["userName"]) self.username = self.jobObj["jobInfo"]["userName"] self.prepare(self.username) self.execute() self.pendingQueue.moveJobTo("ready") print("Job MOVED!") Loading