ansible: minor tidy up

wip-fakessh-exit-status
David Wilson 7 years ago
parent d1888f1908
commit cd455e8c58

@ -201,24 +201,23 @@ class Connection(ansible.plugins.connection.ConnectionBase):
if self.connected: if self.connected:
return return
path = os.environ['MITOGEN_LISTENER_PATH']
self.broker = mitogen.master.Broker() self.broker = mitogen.master.Broker()
self.router, self.parent = mitogen.unix.connect( self.router, self.parent = mitogen.unix.connect(
path=path, path=os.environ['MITOGEN_LISTENER_PATH'],
broker=self.broker, broker=self.broker,
) )
if self.original_transport == 'local': if self.original_transport == 'local':
if not self._play_context.become: if self._play_context.become:
self.context = self._connect_local()
else:
self.context = self._connect_sudo(python_path=sys.executable) self.context = self._connect_sudo(python_path=sys.executable)
else:
self.context = self._connect_local()
else: else:
self.host = self._connect_ssh() self.host = self._connect_ssh()
if not self._play_context.become: if self._play_context.become:
self.context = self.host
else:
self.context = self._connect_sudo(via=self.host) self.context = self._connect_sudo(via=self.host)
else:
self.context = self.host
def close(self): def close(self):
""" """

Loading…
Cancel
Save