Exemple #1
0
    def expire_logs(self):
        if self.config.logexpireminutes == 0 and self.config.statslogexpireinterval == 0:
            return

        if self.config.standalone:
            success, output = execute.run_localcmd(os.path.join(self.config.scriptsdir, "expire-logs"))

            if not success:
                self.ui.error("expire-logs failed\n%s" % output)
        else:
            nodes = self.config.hosts(tag=node_mod.logger_group())

            if not nodes:
                nodes = self.config.hosts(tag=node_mod.manager_group())

            expirelogs = os.path.join(self.config.scriptsdir, "expire-logs")
            cmds = [(node, expirelogs, []) for node in nodes]

            for (node, success, output) in self.executor.run_cmds(cmds):
                if not success:
                    self.ui.error("expire-logs failed for node %s\n" % node)
                    if output:
                        self.ui.error(output)
Exemple #2
0
 def loggers(self):
     return self.nodes(node_mod.logger_group())