fix exception

This commit is contained in:
s.mostryukov 2025-06-19 14:49:29 +03:00
parent 49e62892c8
commit 1c3ee16853
1 changed files with 4 additions and 1 deletions

View File

@ -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)