AsusWRT log exceptions (#12668)
* logexception * Improve err message #2978 * not quiet * tests
This commit is contained in:
1 parent
6a665ffb84
commit
446390a8d1
2 files changed
+8
-9
No files matched your search
@@ -283,15 +283,15 @@ class SshConnection(_Connection):
|
||||
lines = self._ssh.before.split(b'\n')[1:-1]
|
||||
return [line.decode('utf-8') for line in lines]
|
||||
except exceptions.EOF as err:
|
||||
_LOGGER.error("Connection refused. SSH enabled?")
|
||||
_LOGGER.error("Connection refused. %s", self._ssh.before)
|
||||
self.disconnect()
|
||||
return None
|
||||
except pxssh.ExceptionPxssh as err:
|
||||
_LOGGER.error("Unexpected SSH error: %s", str(err))
|
||||
_LOGGER.error("Unexpected SSH error: %s", err)
|
||||
self.disconnect()
|
||||
return None
|
||||
except AssertionError as err:
|
||||
_LOGGER.error("Connection to router unavailable: %s", str(err))
|
||||
_LOGGER.error("Connection to router unavailable: %s", err)
|
||||
self.disconnect()
|
||||
return None
|
||||
|
||||
@@ -301,10 +301,10 @@ class SshConnection(_Connection):
|
||||
|
||||
self._ssh = pxssh.pxssh()
|
||||
if self._ssh_key:
|
||||
self._ssh.login(self._host, self._username,
|
||||
self._ssh.login(self._host, self._username, quiet=False,
|
||||
ssh_key=self._ssh_key, port=self._port)
|
||||
else:
|
||||
self._ssh.login(self._host, self._username,
|
||||
self._ssh.login(self._host, self._username, quiet=False,
|
||||
password=self._password, port=self._port)
|
||||
|
||||
super().connect()
|
||||
|
||||
Reference in new issue
Block a user