Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netmiko proxy import fixes #62412

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/62405.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Due to changes in the Netmiko library for the exception paths, need to check the version of Netmiko python library and then import the exceptions from different locations depending on the result.
13 changes: 11 additions & 2 deletions salt/proxy/netmiko_px.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,17 @@

try:
from netmiko import ConnectHandler
from netmiko.ssh_exception import NetMikoTimeoutException
from netmiko.ssh_exception import NetMikoAuthenticationException

try:
from netmiko import (
NetMikoAuthenticationException,
NetMikoTimeoutException,
)
except ImportError:
from netmiko.ssh_exception import (
NetMikoTimeoutException,
NetMikoAuthenticationException,
)

HAS_NETMIKO = True
except ImportError:
Expand Down