From 83cca84fa0e9cc2bb7cd5cfe60c8e8cb46dab3e0 Mon Sep 17 00:00:00 2001 From: Cristiano Urban Date: Fri, 25 Jun 2021 12:53:42 +0200 Subject: [PATCH] Added admin email as recipient. Signed-off-by: Cristiano Urban --- transfer_service/group_rw_executor.py | 6 ++++-- transfer_service/import_executor.py | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/transfer_service/group_rw_executor.py b/transfer_service/group_rw_executor.py index b627c85..bd9403b 100644 --- a/transfer_service/group_rw_executor.py +++ b/transfer_service/group_rw_executor.py @@ -26,6 +26,8 @@ class GroupRwExecutor(TaskExecutor): params["db"], 1, 1) + params = config.loadSection("mail") + self.adminEmail = params["admin_email"] params = config.loadSection("logging") self.logger = logging.getLogger("GroupRwExecutor") logLevel = "logging." + params["log_level"] @@ -50,7 +52,7 @@ class GroupRwExecutor(TaskExecutor): super(GroupRwExecutor, self).__init__() def updateGroupRw(self): - """This method adds/removes groups to group_read and group_write.""" + """This method adds/removes groups to/from 'group_read' and 'group_write'.""" self.dbConn.setPhase(self.jobId, "EXECUTING") self.dbConn.setStartTime(self.jobId) @@ -70,7 +72,7 @@ class GroupRwExecutor(TaskExecutor): # Send e-mail notification m = Mailer() - m.addRecipient("cristiano.urban@inaf.it") + m.addRecipient(self.adminEmail) if self.requestType == "GRPR_ADD": msg = f""" Added '{self.realGroupName}' to 'group_read' for {self.vospacePath} and any child nodes. diff --git a/transfer_service/import_executor.py b/transfer_service/import_executor.py index ee7ba67..e2ef62c 100644 --- a/transfer_service/import_executor.py +++ b/transfer_service/import_executor.py @@ -35,6 +35,8 @@ class ImportExecutor(TaskExecutor): params.getint("port"), params["user"], params["pkey_file_path"]) + params = config.loadSection("mail") + self.adminEmail = params["admin_email"] params = config.loadSection("logging") self.logger = logging.getLogger("ImportExecutor") logLevel = "logging." + params["log_level"] @@ -175,7 +177,7 @@ class ImportExecutor(TaskExecutor): # Send e-mail notification m = Mailer() - m.addRecipient("cristiano.urban@inaf.it") + m.addRecipient(self.adminEmail) msg = f""" [VOSpace import procedure summary] -- GitLab