fix exception
This commit is contained in:
parent
49e62892c8
commit
1c3ee16853
|
@ -77,7 +77,7 @@ def send_command(connection: ConnectHandler, command: str) -> str:
|
|||
except exceptions.NetmikoTimeoutException:
|
||||
result = "NetmikoTimeoutException"
|
||||
except exceptions.ReadTimeout:
|
||||
result = "NetmikoTimeoutException"
|
||||
result = "ReadTimeout"
|
||||
return result
|
||||
|
||||
|
||||
|
@ -93,6 +93,9 @@ def save_mikrotik_bcp(host: str, name: str) -> None:
|
|||
result = send_command(connection, "export terse show-sensitive")
|
||||
connection.disconnect()
|
||||
if result == "NetmikoTimeoutException":
|
||||
log.warning("Timeout error %r", name)
|
||||
return
|
||||
elif result == "ReadTimeout":
|
||||
log.warning("Timeout read config from %r", name)
|
||||
return
|
||||
log.info("disconnected from %r", name)
|
||||
|
|
Loading…
Reference in New Issue