mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-01 21:14:32 +02:00
pylint consistency
This commit is contained in:
parent
8769c322a3
commit
a6e6f4c697
3 changed files with 28 additions and 16 deletions
|
@ -56,11 +56,11 @@ class MikrotikAPI:
|
|||
try:
|
||||
self._connection = librouteros.connect(self._host, self._username, self._password, **kwargs)
|
||||
except (
|
||||
librouteros.exceptions.TrapError,
|
||||
librouteros.exceptions.MultiTrapError,
|
||||
librouteros.exceptions.ConnectionClosed,
|
||||
librouteros.exceptions.ProtocolError,
|
||||
librouteros.exceptions.FatalError
|
||||
librouteros.exceptions.TrapError,
|
||||
librouteros.exceptions.MultiTrapError,
|
||||
librouteros.exceptions.ConnectionClosed,
|
||||
librouteros.exceptions.ProtocolError,
|
||||
librouteros.exceptions.FatalError
|
||||
) as api_error:
|
||||
_LOGGER.error("Mikrotik %s: %s", self._host, api_error)
|
||||
self.error_to_strings("%s" % api_error)
|
||||
|
@ -107,10 +107,10 @@ class MikrotikAPI:
|
|||
self._connection = None
|
||||
return None
|
||||
except (
|
||||
librouteros.exceptions.TrapError,
|
||||
librouteros.exceptions.MultiTrapError,
|
||||
librouteros.exceptions.ProtocolError,
|
||||
librouteros.exceptions.FatalError
|
||||
librouteros.exceptions.TrapError,
|
||||
librouteros.exceptions.MultiTrapError,
|
||||
librouteros.exceptions.ProtocolError,
|
||||
librouteros.exceptions.FatalError
|
||||
) as api_error:
|
||||
_LOGGER.error("Mikrotik %s connection error %s", self._host, api_error)
|
||||
return None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue