Add support for multiple long engines.

NOTE: .cfg changed!


git-svn-id: https://kippo.googlecode.com/svn/trunk@173 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
desaster
2010-10-23 12:32:49 +00:00
parent 4af62a5baf
commit b4a2e04d99
3 changed files with 10 additions and 10 deletions

View File

@@ -366,12 +366,13 @@ class HoneyPotSSHFactory(factory.SSHFactory):
def __init__(self):
cfg = config()
if cfg.has_option('database', 'engine'):
engine = cfg.get('database', 'engine')
self.dblogger = __import__(
for engine in [x[9:] for x in cfg.sections() \
if x.startswith('database_')]:
print 'Loading dblog engine: %s' % (engine,)
dblogger = __import__(
'kippo.dblog.%s' % (engine,),
globals(), locals(), ['dblog']).DBLogger(cfg)
log.startLoggingWithObserver(self.dblogger.emit, setStdout=False)
log.startLoggingWithObserver(dblogger.emit, setStdout=False)
def buildProtocol(self, addr):
# FIXME: try to mimic something real 100%