connection: use close from superclass
We had our own re-implemented close function from when this was first introduced which has since then drifted a lot from Ansible. This drops all that code so that we can use the superclass when closing the connection. Change-Id: Id62e510af035988084453883278c3db85c8b7519
This commit is contained in:
parent
e085907160
commit
74ae653e2f
|
@ -551,15 +551,3 @@ class Connection(SSH.Connection):
|
||||||
self.container_user = 'root'
|
self.container_user = 'root'
|
||||||
self.exec_command('chown %s %s' % (_user, out_path))
|
self.exec_command('chown %s %s' % (_user, out_path))
|
||||||
self.container_user = _user
|
self.container_user = _user
|
||||||
|
|
||||||
def close(self):
|
|
||||||
# If we have a persistent ssh connection (ControlPersist), we can ask it
|
|
||||||
# to stop listening. Otherwise, there's nothing to do here.
|
|
||||||
if self._connected and self._persistent:
|
|
||||||
cmd = self._build_command('ssh', '-O', 'stop', self.host)
|
|
||||||
cmd = map(SSH.to_bytes, cmd)
|
|
||||||
p = SSH.subprocess.Popen(cmd,
|
|
||||||
stdin=SSH.subprocess.PIPE,
|
|
||||||
stdout=SSH.subprocess.PIPE,
|
|
||||||
stderr=SSH.subprocess.PIPE)
|
|
||||||
p.communicate()
|
|
||||||
|
|
Loading…
Reference in New Issue