Loading transfer_service/retrieve_executor.py +6 −5 Original line number Diff line number Diff line Loading @@ -258,9 +258,10 @@ class RetrieveExecutor(TaskExecutor): """ results = [{"target": ""}] results[0]["target"] = self.jobObj.jobInfo["transfer"]["target"] self.dbConn.setResults(self.jobId, results) #self.dbConn.setResults(self.jobId, results) self.jobObj.setResults(results) self.jobObj.setPhase("COMPLETED") self.dbConn.setPhase(self.jobId, "COMPLETED") self.dbConn.insertJob(self.jobObj) self.dbConn.setEndTime(self.jobId) self.jobObj.endTime = datetime.datetime.now().isoformat() Loading @@ -275,9 +276,7 @@ class RetrieveExecutor(TaskExecutor): self.destPathList.append(destPath) self.jobObj.jobInfo["destPathList"] = self.destPathList.copy() # Send e-mail notification m = Mailer(self.logger) m.addRecipient(self.adminEmail) userEmail = self.dbConn.getUserEmail(self.jobObj.ownerId) if userEmail != self.adminEmail: Loading @@ -294,6 +293,8 @@ class RetrieveExecutor(TaskExecutor): Your files are available and can be downloaded. """ # Send e-mail notification m.setMessage("VOSpace data retrieve notification: Job COMPLETED", msg) m.send() Loading transfer_service/retrieve_preprocessor.py +3 −3 Original line number Diff line number Diff line Loading @@ -51,9 +51,7 @@ class RetrievePreprocessor(TaskExecutor): self.jobObj.jobInfo["nodeList"] = self.nodeList.copy() def update(self, status): # Send e-mail notification m = Mailer(self.logger) m.addRecipient(self.adminEmail) userEmail = self.dbConn.getUserEmail(self.jobObj.ownerId) if userEmail != self.adminEmail: Loading @@ -68,6 +66,8 @@ class RetrievePreprocessor(TaskExecutor): Owner ID: {self.jobObj.ownerId} """ # Send e-mail notification m.setMessage(f"VOSpace data retrieve notification: Job {status}", msg) m.send() Loading transfer_service/store_executor.py +8 −6 Original line number Diff line number Diff line Loading @@ -124,7 +124,6 @@ class StoreExecutor(TaskExecutor): results = [{"target": ""}] self.dbConn.setResults(self.jobId, results) # Send e-mail notification m = Mailer(self.logger) m.addRecipient(self.adminEmail) self.userEmail = self.dbConn.getUserEmail(self.userId) Loading Loading @@ -181,12 +180,15 @@ class StoreExecutor(TaskExecutor): """ msg += info m.setMessage("VOSpace data storage notification", msg) # Send e-mail notification m.send() else: self.logger.info("Updating job phase to ERROR") self.jobObj.setPhase("ERROR") self.dbConn.setPhase(self.jobId, "ERROR") self.jobObj.setErrorType("fatal") self.jobObj.setErrorMessage("FATAL: something went wrong during the execution phase.") self.dbConn.insertJob(self.jobObj) self.dbConn.setEndTime(self.jobId) self.logger.info("Job phase updated to ERROR.") msg = f""" ########## VOSpace data storage procedure summary ########## Loading Loading @@ -216,7 +218,7 @@ class StoreExecutor(TaskExecutor): def cleanup(self): try: srcPathPrefix = self.storageStorePath.replace("{username}", self.username) self.logger.info(f"Cleanup of {srcPathPrefix}...") self.logger.info(f"Cleanup of '{srcPathPrefix}'...") srcData = os.listdir(srcPathPrefix) for el in srcData: nodeOSPath = srcPathPrefix + '/' + el Loading transfer_service/store_preprocessor.py +7 −6 Original line number Diff line number Diff line Loading @@ -220,17 +220,16 @@ class StorePreprocessor(TaskExecutor): def update(self, status): try: m = Mailer(self.logger) m.addRecipient(self.adminEmail) userEmail = self.dbConn.getUserEmail(self.jobObj.ownerId) if userEmail != self.adminEmail: m.addRecipient(userEmail) if status == "OK": self.logger.info("Job phase updated to QUEUED.") self.jobObj.setPhase("QUEUED") self.dbConn.setPhase(self.jobId, "QUEUED") # Send e-mail notification self.logger.info("Job phase updated to QUEUED.") msg = f""" Dear user, your job has been QUEUED. Loading @@ -247,13 +246,13 @@ class StorePreprocessor(TaskExecutor): m.setMessage("VOSpace data storage notification: Job QUEUED", msg) m.send() else: # Send e-mail notification self.logger.info("Job phase updated to ERROR.") self.jobObj.setPhase("ERROR") self.jobObj.setErrorType("fatal") self.jobObj.setErrorMessage("FATAL: something went wrong during the preprocessing phase.") self.dbConn.insertJob(self.jobObj) self.dbConn.setEndTime(self.jobId) self.setDestinationQueueName("write_terminated") self.logger.info("Job phase updated to ERROR.") msg = f""" Dear user, Loading @@ -268,6 +267,8 @@ class StorePreprocessor(TaskExecutor): This issue will be automatically reported to the administrator. """ # Send e-mail notification m.setMessage("VOSpace data storage notification: Job ERROR", msg) m.send() except Exception: Loading Loading
transfer_service/retrieve_executor.py +6 −5 Original line number Diff line number Diff line Loading @@ -258,9 +258,10 @@ class RetrieveExecutor(TaskExecutor): """ results = [{"target": ""}] results[0]["target"] = self.jobObj.jobInfo["transfer"]["target"] self.dbConn.setResults(self.jobId, results) #self.dbConn.setResults(self.jobId, results) self.jobObj.setResults(results) self.jobObj.setPhase("COMPLETED") self.dbConn.setPhase(self.jobId, "COMPLETED") self.dbConn.insertJob(self.jobObj) self.dbConn.setEndTime(self.jobId) self.jobObj.endTime = datetime.datetime.now().isoformat() Loading @@ -275,9 +276,7 @@ class RetrieveExecutor(TaskExecutor): self.destPathList.append(destPath) self.jobObj.jobInfo["destPathList"] = self.destPathList.copy() # Send e-mail notification m = Mailer(self.logger) m.addRecipient(self.adminEmail) userEmail = self.dbConn.getUserEmail(self.jobObj.ownerId) if userEmail != self.adminEmail: Loading @@ -294,6 +293,8 @@ class RetrieveExecutor(TaskExecutor): Your files are available and can be downloaded. """ # Send e-mail notification m.setMessage("VOSpace data retrieve notification: Job COMPLETED", msg) m.send() Loading
transfer_service/retrieve_preprocessor.py +3 −3 Original line number Diff line number Diff line Loading @@ -51,9 +51,7 @@ class RetrievePreprocessor(TaskExecutor): self.jobObj.jobInfo["nodeList"] = self.nodeList.copy() def update(self, status): # Send e-mail notification m = Mailer(self.logger) m.addRecipient(self.adminEmail) userEmail = self.dbConn.getUserEmail(self.jobObj.ownerId) if userEmail != self.adminEmail: Loading @@ -68,6 +66,8 @@ class RetrievePreprocessor(TaskExecutor): Owner ID: {self.jobObj.ownerId} """ # Send e-mail notification m.setMessage(f"VOSpace data retrieve notification: Job {status}", msg) m.send() Loading
transfer_service/store_executor.py +8 −6 Original line number Diff line number Diff line Loading @@ -124,7 +124,6 @@ class StoreExecutor(TaskExecutor): results = [{"target": ""}] self.dbConn.setResults(self.jobId, results) # Send e-mail notification m = Mailer(self.logger) m.addRecipient(self.adminEmail) self.userEmail = self.dbConn.getUserEmail(self.userId) Loading Loading @@ -181,12 +180,15 @@ class StoreExecutor(TaskExecutor): """ msg += info m.setMessage("VOSpace data storage notification", msg) # Send e-mail notification m.send() else: self.logger.info("Updating job phase to ERROR") self.jobObj.setPhase("ERROR") self.dbConn.setPhase(self.jobId, "ERROR") self.jobObj.setErrorType("fatal") self.jobObj.setErrorMessage("FATAL: something went wrong during the execution phase.") self.dbConn.insertJob(self.jobObj) self.dbConn.setEndTime(self.jobId) self.logger.info("Job phase updated to ERROR.") msg = f""" ########## VOSpace data storage procedure summary ########## Loading Loading @@ -216,7 +218,7 @@ class StoreExecutor(TaskExecutor): def cleanup(self): try: srcPathPrefix = self.storageStorePath.replace("{username}", self.username) self.logger.info(f"Cleanup of {srcPathPrefix}...") self.logger.info(f"Cleanup of '{srcPathPrefix}'...") srcData = os.listdir(srcPathPrefix) for el in srcData: nodeOSPath = srcPathPrefix + '/' + el Loading
transfer_service/store_preprocessor.py +7 −6 Original line number Diff line number Diff line Loading @@ -220,17 +220,16 @@ class StorePreprocessor(TaskExecutor): def update(self, status): try: m = Mailer(self.logger) m.addRecipient(self.adminEmail) userEmail = self.dbConn.getUserEmail(self.jobObj.ownerId) if userEmail != self.adminEmail: m.addRecipient(userEmail) if status == "OK": self.logger.info("Job phase updated to QUEUED.") self.jobObj.setPhase("QUEUED") self.dbConn.setPhase(self.jobId, "QUEUED") # Send e-mail notification self.logger.info("Job phase updated to QUEUED.") msg = f""" Dear user, your job has been QUEUED. Loading @@ -247,13 +246,13 @@ class StorePreprocessor(TaskExecutor): m.setMessage("VOSpace data storage notification: Job QUEUED", msg) m.send() else: # Send e-mail notification self.logger.info("Job phase updated to ERROR.") self.jobObj.setPhase("ERROR") self.jobObj.setErrorType("fatal") self.jobObj.setErrorMessage("FATAL: something went wrong during the preprocessing phase.") self.dbConn.insertJob(self.jobObj) self.dbConn.setEndTime(self.jobId) self.setDestinationQueueName("write_terminated") self.logger.info("Job phase updated to ERROR.") msg = f""" Dear user, Loading @@ -268,6 +267,8 @@ class StorePreprocessor(TaskExecutor): This issue will be automatically reported to the administrator. """ # Send e-mail notification m.setMessage("VOSpace data storage notification: Job ERROR", msg) m.send() except Exception: Loading