async def _establish_connection(self) -> Tuple[bool, str]:
f'Host "{self._host}": Establishing connection to port {self._port}'
)
fut = asyncssh.connect(**self._params)
try:
self._conn = await asyncio.wait_for(fut, self._timeout)
except asyncssh.DisconnectError as err:
# raise DisconnectError(self._host, err.code, )
return False, err.reason
except asyncio.TimeoutError:
reason = f"host didn't responsed for {self._timeout}s"
return False, reason
# raise TimeoutError(self._host, reason
self._stdin, self._stdout, self._stderr = await self._conn.open_session(
term_type="Dumb"
)