Change the way kwargs are passed.

This commit is contained in:
rajvidhimar 2017-01-27 10:35:15 +05:30
parent 60d06df00a
commit 2d1530fd6d

View File

@ -342,13 +342,11 @@ class SyslogServerFactory(DatagramProtocol):
def handle_error(self, err_msg):
'''
Log the error messages.
'''
log.error(err_msg.getErrorMessage)
def datagramReceived(self, data, connection_details):
# This is dont to make the code autopep8 compliant
# Cannot specify the tuple directly as an argument of datagramReceived
(host, port) = connection_details
d = threads.deferToThread(
self.parseData,
@ -361,7 +359,6 @@ class SyslogServerFactory(DatagramProtocol):
def start(port=516, **kwargs):
options = kwargs
log.info('Starting junos syslog engine (port {0})'.format(port))
reactor.listenUDP(port, SyslogServerFactory(options))
reactor.listenUDP(port, SyslogServerFactory(kwargs))
reactor.run()