# HG changeset patch # User Tero Marttila # Date 1265307262 -7200 # Node ID 81b37185209ca9adaa07abe62ababb4747ea2bf6 # Parent ee58a22e5baae2118e323f0603584d4edc5ba5b5 move fixbot.logwatch.logwatch to fixbot.logwatch diff -r ee58a22e5baa -r 81b37185209c fixbot/logwatch/__init__.py --- a/fixbot/logwatch/__init__.py Thu Feb 04 20:11:36 2010 +0200 +++ b/fixbot/logwatch/__init__.py Thu Feb 04 20:14:22 2010 +0200 @@ -0,0 +1,31 @@ +from fixbot import api + +class LogWatchModule (api.Module) : + name = "logs" + + event_types = [ + "error", + "sudo", + "ssh", + "all" + ] + + def __init__ (self, config) : + """ + Initialize with logwatch_sources from config + """ + + super(LogWatchModule, self).__init__(config) + + self.sources = config['logwatch-sources'] + + def handleConnect (self) : + for source in self.sources : + source.setModule(self) + + def error (self, msg) : + self.sendEvent("error", msg) + +def makeService (config) : + return api.makeService(LogWatchModule, config) + diff -r ee58a22e5baa -r 81b37185209c fixbot/logwatch/logwatch.py --- a/fixbot/logwatch/logwatch.py Thu Feb 04 20:11:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -from twisted.internet import protocol, reactor -from twisted.python import log -import sys - -from fixbot import api - -class LogWatchModule (api.Module) : - name = "logs" - version = 0x0005 - - event_types = [ - "error", - "sudo", - "ssh", - "all" - ] - - def __init__ (self, config) : - """ - Initialize with logwatch_sources from config - """ - - super(LogWatchModule, self).__init__(config) - - self.sources = config['logwatch-sources'] - - def handleConnect (self) : - for source in self.sources : - source.setModule(self) - - def error (self, msg) : - self.sendEvent("error", msg) - -def makeService (config) : - return api.makeService(LogWatchModule, config) - diff -r ee58a22e5baa -r 81b37185209c twisted/plugins/fixbot_logwatch_plugin.py --- a/twisted/plugins/fixbot_logwatch_plugin.py Thu Feb 04 20:11:36 2010 +0200 +++ b/twisted/plugins/fixbot_logwatch_plugin.py Thu Feb 04 20:14:22 2010 +0200 @@ -7,7 +7,7 @@ from twisted.application import internet from fixbot import api -from fixbot.logwatch import logwatch +from fixbot import logwatch class LogwatchOptions (api.ClientOptions) : optParameters = [