mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
add io_loop handling to runtests engine
This commit is contained in:
parent
fd074fdb7d
commit
47b6d409d1
@ -21,6 +21,7 @@ import logging
|
||||
|
||||
# Import salt libs
|
||||
import salt.utils.event
|
||||
import salt.utils.async
|
||||
|
||||
# Import 3rd-party libs
|
||||
from tornado import gen
|
||||
@ -69,11 +70,11 @@ class PyTestEngine(object):
|
||||
self.sock.bind(('localhost', port))
|
||||
# become a server socket
|
||||
self.sock.listen(5)
|
||||
netutil.add_accept_handler(
|
||||
self.sock,
|
||||
self.handle_connection,
|
||||
io_loop=self.io_loop,
|
||||
)
|
||||
with salt.utils.async.current_ioloop(self.io_loop):
|
||||
netutil.add_accept_handler(
|
||||
self.sock,
|
||||
self.handle_connection,
|
||||
)
|
||||
|
||||
def handle_connection(self, connection, address):
|
||||
log.warning('Accepted connection from %s. Role: %s', address, self.opts['__role'])
|
||||
|
Loading…
Reference in New Issue
Block a user