From dd8271f0610d4a26ef84d9f6f5b10bf735660025 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Thu, 21 Sep 2017 20:03:51 +0100 Subject: [PATCH] Fix stale references to m.master.connect & m.ssh.connect I'm fairly sure these updates are correct, but I'm not able to run the test suite to confirm. --- mitogen/ansible/connection.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mitogen/ansible/connection.py b/mitogen/ansible/connection.py index d35944f6..25849eb1 100644 --- a/mitogen/ansible/connection.py +++ b/mitogen/ansible/connection.py @@ -39,11 +39,13 @@ class Connection(ansible.plugins.connection.ConnectionBase): if self.connected: return self.broker = mitogen.master.Broker() + self.router = mitogen.master.Router(self.broker) if self._play_context.remote_addr == 'localhost': - self.context = mitogen.master.connect(self.broker) + self.context = self.router.connect(mitogen.master.Stream) else: - self.context = mitogen.ssh.connect(broker, - self._play_context.remote_addr) + self.context = self.router.connect(mitogen.ssh.Stream, + hostname=self._play_context.remote_addr, + ) def exec_command(self, cmd, in_data=None, sudoable=True): super(Connection, self).exec_command(cmd, in_data=in_data, sudoable=sudoable)