Commit dd8271f0 authored by Alex Willmer's avatar Alex Willmer Committed by David Wilson

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.
parent d706b7d6
...@@ -39,11 +39,13 @@ class Connection(ansible.plugins.connection.ConnectionBase): ...@@ -39,11 +39,13 @@ class Connection(ansible.plugins.connection.ConnectionBase):
if self.connected: if self.connected:
return return
self.broker = mitogen.master.Broker() self.broker = mitogen.master.Broker()
self.router = mitogen.master.Router(self.broker)
if self._play_context.remote_addr == 'localhost': if self._play_context.remote_addr == 'localhost':
self.context = mitogen.master.connect(self.broker) self.context = self.router.connect(mitogen.master.Stream)
else: else:
self.context = mitogen.ssh.connect(broker, self.context = self.router.connect(mitogen.ssh.Stream,
self._play_context.remote_addr) hostname=self._play_context.remote_addr,
)
def exec_command(self, cmd, in_data=None, sudoable=True): def exec_command(self, cmd, in_data=None, sudoable=True):
super(Connection, self).exec_command(cmd, in_data=in_data, sudoable=sudoable) super(Connection, self).exec_command(cmd, in_data=in_data, sudoable=sudoable)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment