From 850774d625c8c396b439199db2a1014adc1c3bb5 Mon Sep 17 00:00:00 2001 From: Cristiano Urban Date: Sat, 23 Jan 2021 12:46:46 +0100 Subject: [PATCH] Added support for single node and list of nodes. Signed-off-by: Cristiano Urban --- transfer_service/retrieve_preprocessor.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/transfer_service/retrieve_preprocessor.py b/transfer_service/retrieve_preprocessor.py index 500dfa6..594f387 100644 --- a/transfer_service/retrieve_preprocessor.py +++ b/transfer_service/retrieve_preprocessor.py @@ -18,12 +18,15 @@ class RetrievePreprocessor(TaskExecutor): super(RetrievePreprocessor, self).__init__() def execute(self): + nodeType = self.jobObj.jobInfo["transfer"]["protocols"][0]["param"][0]["value"] vospacePath = self.jobObj.jobInfo["transfer"]["target"].split("!vospace")[1] - self.dbConn.connect() - osPath = self.dbConn.getOSPath(vospacePath) - self.dbConn.disconnect() - self.nodeList.append(osPath) - self.jobObj.jobInfo["transfer"]["nodeList"] = self.nodeList + if nodeType == "single": + self.nodeList.append(vospacePath) + else: + self.dbConn.connect() + self.nodeList = self.dbConn.getVOSpacePathList(vospacePath) + self.dbConn.disconnect() + self.jobObj.jobInfo["nodeList"] = self.nodeList def run(self): print("Starting retrieve preprocessor...") @@ -32,7 +35,7 @@ class RetrievePreprocessor(TaskExecutor): while True: self.wait() if self.destQueue.len() < self.maxReadyJobs and self.srcQueue.len() > 0: - self.jobObj = self.srcQueue.getJob() + self.jobObj = self.srcQueue.getJob() self.execute() self.srcQueue.extractJob() self.destQueue.insertJob(self.jobObj) -- GitLab