mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Fix TCP Transport to work with Tornado 4.5
TCP transport's `TCPClientKeepAlive` derives from `tornado.tcpclient.TCPClient` and overrides `_create_stream`. Tornado 4.5 added the kwargs `source_ip` and `source_port` to `_create_stream`. This new functionality is not needed by Salt. To be backwards and forwards compatible, add `**kwargs` to swallow these and any future kwargs that are added. Signed-off-by: Sergey Kizunov <sergey.kizunov@ni.com>
This commit is contained in:
parent
7861f12df8
commit
958ecdace8
@ -745,7 +745,14 @@ class TCPClientKeepAlive(tornado.tcpclient.TCPClient):
|
||||
super(TCPClientKeepAlive, self).__init__(
|
||||
resolver=resolver, io_loop=io_loop)
|
||||
|
||||
def _create_stream(self, max_buffer_size, af, addr):
|
||||
def _create_stream(self, max_buffer_size, af, addr, **kwargs): # pylint: disable=unused-argument
|
||||
'''
|
||||
Override _create_stream() in TCPClient.
|
||||
|
||||
Tornado 4.5 added the kwargs 'source_ip' and 'source_port'.
|
||||
Due to this, use **kwargs to swallow these and any future
|
||||
kwargs to maintain compatibility.
|
||||
'''
|
||||
# Always connect in plaintext; we'll convert to ssl if necessary
|
||||
# after one connection has completed.
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
|
Loading…
Reference in New Issue
Block a user