remove warnings for closing ttylog msg

This commit is contained in:
Michel Oosterhof
2015-02-26 17:02:23 +00:00
parent 8928cb10fa
commit 4c43a99ad2
2 changed files with 9 additions and 4 deletions

View File

@ -45,6 +45,7 @@ class DBLogger(object):
'KIPP0009': self.handleClientVersion, 'KIPP0009': self.handleClientVersion,
'KIPP0010': self.handleTerminalSize, 'KIPP0010': self.handleTerminalSize,
'KIPP0011': self._connectionLost, 'KIPP0011': self._connectionLost,
'KIPP0012': self.handleTTYLogClosed,
} }
self.start(cfg) self.start(cfg)
@ -126,9 +127,13 @@ class DBLogger(object):
def createSession(self, peerIP, peerPort, hostIP, hostPort): def createSession(self, peerIP, peerPort, hostIP, hostPort):
return 0 return 0
# args has: logfile # args has: ttylog
def handleTTYLogOpened(self, session, args): def handleTTYLogOpened(self, session, args):
self.ttylogs[session] = args['logfile'] self.ttylogs[session] = args['ttylog']
# args has: ttylog
def handleTTYLogClosed(self, session, args):
self.ttylogs[session] = args['ttylog']
# args is empty # args is empty
def handleConnectionLost(self, session, args): def handleConnectionLost(self, session, args):

View File

@ -238,8 +238,8 @@ class LoggingServerProtocol(insults.ServerProtocol):
time.strftime('%Y%m%d-%H%M%S'), transport.transportId ) time.strftime('%Y%m%d-%H%M%S'), transport.transportId )
self.ttylog_file = transport.ttylog_file self.ttylog_file = transport.ttylog_file
log.msg( eventid='KIPP0004', logfile=transport.ttylog_file, log.msg( eventid='KIPP0004', ttylog=transport.ttylog_file,
format='Opening TTY Log: %(logfile)s') format='Opening TTY Log: %(ttylog)s')
ttylog.ttylog_open(transport.ttylog_file, time.time()) ttylog.ttylog_open(transport.ttylog_file, time.time())
self.ttylog_open = True self.ttylog_open = True