Commit ad3d93b2 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Minor fixes.

parent a288dec1
Loading
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -56,16 +56,16 @@ class GroupRwExecutor(TaskExecutor):
            self.dbConn.setStartTime(self.jobId)
            self.dbConn.setStartTime(self.jobId)
        
        
            if self.requestType == "GRPR_ADD":
            if self.requestType == "GRPR_ADD":
                self.logger.info(f"CMD: vos_group read add {self.groupName} {self.vospacePath}")                
                self.logger.info(f"User command: vos_group read add {self.groupName[0]} {self.vospacePath}")                
                self.dbConn.updateGroupRead(self.groupName, [], self.vospacePath)
                self.dbConn.updateGroupRead(self.groupName, [], self.vospacePath)
            elif self.requestType == "GRPR_DEL":
            elif self.requestType == "GRPR_DEL":
                self.logger.info(f"CMD: vos_group read del {self.groupName} {self.vospacePath}")
                self.logger.info(f"User command: vos_group read del {self.groupName[0]} {self.vospacePath}")
                self.dbConn.updateGroupRead([], self.groupName, self.vospacePath)
                self.dbConn.updateGroupRead([], self.groupName, self.vospacePath)
            elif self.requestType == "GRPW_ADD":
            elif self.requestType == "GRPW_ADD":
                self.logger.info(f"CMD: vos_group write add {self.groupName} {self.vospacePath}")
                self.logger.info(f"User command: vos_group write add {self.groupName[0]} {self.vospacePath}")
                self.dbConn.updateGroupWrite(self.groupName, [], self.vospacePath)
                self.dbConn.updateGroupWrite(self.groupName, [], self.vospacePath)
            elif self.requestType == "GRPW_DEL":
            elif self.requestType == "GRPW_DEL":
                self.logger.info(f"CMD: vos_group write del {self.groupName} {self.vospacePath}")
                self.logger.info(f"User command: vos_group write del {self.groupName[0]} {self.vospacePath}")
                self.dbConn.updateGroupWrite([], self.groupName, self.vospacePath)
                self.dbConn.updateGroupWrite([], self.groupName, self.vospacePath)
        except Exception:
        except Exception:
            self.logger.exception("FATAL: something went wrong during the execution phase.")
            self.logger.exception("FATAL: something went wrong during the execution phase.")
@@ -79,7 +79,6 @@ class GroupRwExecutor(TaskExecutor):
            results = [{"target": ""}]
            results = [{"target": ""}]
            self.dbConn.setResults(self.jobId, results)
            self.dbConn.setResults(self.jobId, results)


            # Send e-mail notification
            m = Mailer(self.logger)
            m = Mailer(self.logger)
            m.addRecipient(self.adminEmail)
            m.addRecipient(self.adminEmail)
            userEmail = self.dbConn.getUserEmail(self.userId)
            userEmail = self.dbConn.getUserEmail(self.userId)
@@ -116,6 +115,7 @@ Removed '{self.realGroupName}' from 'group_write' for {self.vospacePath} and any
                self.dbConn.insertJob(self.jobObj)
                self.dbConn.insertJob(self.jobObj)
                self.dbConn.setEndTime(self.jobId)
                self.dbConn.setEndTime(self.jobId)
                self.logger.info("Job phase updated to ERROR.")
                self.logger.info("Job phase updated to ERROR.")
            # Send e-mail notification
            m.setMessage("VOSpace group_rw notification", msg)
            m.setMessage("VOSpace group_rw notification", msg)
            m.send()
            m.send()
        except Exception:
        except Exception:
+5 −5
Original line number Original line Diff line number Diff line
@@ -51,7 +51,7 @@ class TapeClient(object):
        try:
        try:
            stdin, stdout, stderr = self.client.exec_command(cmd)
            stdin, stdout, stderr = self.client.exec_command(cmd)
        except Exception:
        except Exception:
            self.logger.exception("Unable to execute command: '{cmd}'")
            self.logger.exception(f"Unable to execute command: '{cmd}'")
            raise
            raise
        else:
        else:
            exitCode = stdout.channel.recv_exit_status()
            exitCode = stdout.channel.recv_exit_status()
@@ -93,7 +93,7 @@ class TapeClient(object):
        try:
        try:
            stdin, stdout, stderr = self.client.exec_command(cmd)
            stdin, stdout, stderr = self.client.exec_command(cmd)
        except Exception:
        except Exception:
            self.logger.exception("Unable to execute command: '{cmd}'")
            self.logger.exception(f"Unable to execute command: '{cmd}'")
            raise
            raise
        else:
        else:
            exitCode = stdout.channel.recv_exit_status()
            exitCode = stdout.channel.recv_exit_status()
@@ -160,7 +160,7 @@ class TapeClient(object):
            try:
            try:
                stdin, stdout, stderr = self.client.exec_command(cmd)
                stdin, stdout, stderr = self.client.exec_command(cmd)
            except Exception:
            except Exception:
                self.logger.exception("Unable to execute command: '{cmd}'")
                self.logger.exception(f"Unable to execute command: '{cmd}'")
                raise
                raise
            else:
            else:
                exitCode = stdout.channel.recv_exit_status()
                exitCode = stdout.channel.recv_exit_status()
@@ -192,7 +192,7 @@ class TapeClient(object):
            try:
            try:
                stdin, stdout, stderr = self.client.exec_command(cmd)
                stdin, stdout, stderr = self.client.exec_command(cmd)
            except Exception:
            except Exception:
                self.logger.exception("Unable to execute command: '{cmd}'")
                self.logger.exception(f"Unable to execute command: '{cmd}'")
                raise
                raise
            else:
            else:
                exitCode = stdout.channel.recv_exit_status()
                exitCode = stdout.channel.recv_exit_status()
@@ -213,7 +213,7 @@ class TapeClient(object):
        try:
        try:
            stdin, stdout, stderr = self.client.exec_command(cmd)
            stdin, stdout, stderr = self.client.exec_command(cmd)
        except Exception:
        except Exception:
            self.logger.exception("Unable to execute command: '{cmd}'")
            self.logger.exception(f"Unable to execute command: '{cmd}'")
            raise
            raise
        else:
        else:
            exitCode = stdout.channel.recv_exit_status()
            exitCode = stdout.channel.recv_exit_status()