def get_client(self):
if self._ssh is None:<EOL><INDENT>self._connect()<EOL>return self._ssh<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>chan = self._ssh.get_transport().open_session()<EOL><DEDENT>except (socket.error, paramiko.SSHException):<EOL><INDENT>logger.warning("<STR_LIT>")<EOL>self._ssh.close()<EOL>self._connect()<EOL><DEDENT>else:<EOL><INDENT>chan.close()<EOL><DEDENT>return self._ssh<EOL><DEDENT>
Gets the SSH client.

        This will check that the connection is still alive first, and reconnect
        if necessary.