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:
|
except exceptions.NetmikoTimeoutException:
|
||||||
result = "NetmikoTimeoutException"
|
result = "NetmikoTimeoutException"
|
||||||
except exceptions.ReadTimeout:
|
except exceptions.ReadTimeout:
|
||||||
result = "NetmikoTimeoutException"
|
result = "ReadTimeout"
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,6 +93,9 @@ def save_mikrotik_bcp(host: str, name: str) -> None:
|
||||||
result = send_command(connection, "export terse show-sensitive")
|
result = send_command(connection, "export terse show-sensitive")
|
||||||
connection.disconnect()
|
connection.disconnect()
|
||||||
if result == "NetmikoTimeoutException":
|
if result == "NetmikoTimeoutException":
|
||||||
|
log.warning("Timeout error %r", name)
|
||||||
|
return
|
||||||
|
elif result == "ReadTimeout":
|
||||||
log.warning("Timeout read config from %r", name)
|
log.warning("Timeout read config from %r", name)
|
||||||
return
|
return
|
||||||
log.info("disconnected from %r", name)
|
log.info("disconnected from %r", name)
|
||||||
|
|
Loading…
Reference in New Issue