-
Hello, I've tried few try\except attempts to no avail. What is the right code to create this exception?
|
Beta Was this translation helpful? Give feedback.
Answered by
ktbyers
Dec 6, 2022
Replies: 2 comments 2 replies
-
This worked fine for me: from netmiko import ConnectHandler, NetmikoTimeoutException
try:
net_connect = ConnectHandler(**my_device)
output = net_connect.send_command("show ip int brief")
print(output)
net_connect.disconnect()
except NetmikoTimeoutException:
print("Connection failed") |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
exlr8in
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This worked fine for me: