diff --git a/labgrid/util/ssh.py b/labgrid/util/ssh.py index 8df205510..a1e8546ed 100644 --- a/labgrid/util/ssh.py +++ b/labgrid/util/ssh.py @@ -525,6 +525,10 @@ def disconnect(self): self._logger.info("Closing SSH connection to %s", self.host) self._stop_keepalive() self._stop_own_master() + + # stop keepalive when existing connection is used + if self._keepalive: + self._stop_keepalive() finally: self._connected = False