mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
netmiko poxy import fixes (#62404)
* need to check the version of Netmiko python library and then import the exceptions from different locations depending on the result. * Adding changelog. * swap out if...else for double try...except.
This commit is contained in:
parent
b8dfef5076
commit
d6307c2a70
2 changed files with 9 additions and 4 deletions
1
changelog/62405.fixed
Normal file
1
changelog/62405.fixed
Normal file
|
@ -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.
|
|
@ -190,10 +190,14 @@ import salt.utils.args
|
|||
|
||||
try:
|
||||
from netmiko import ConnectHandler
|
||||
from netmiko.ssh_exception import (
|
||||
NetMikoAuthenticationException,
|
||||
NetMikoTimeoutException,
|
||||
)
|
||||
|
||||
try:
|
||||
from netmiko import NetMikoAuthenticationException, NetMikoTimeoutException
|
||||
except ImportError:
|
||||
from netmiko.ssh_exception import (
|
||||
NetMikoAuthenticationException,
|
||||
NetMikoTimeoutException,
|
||||
)
|
||||
|
||||
HAS_NETMIKO = True
|
||||
except ImportError:
|
||||
|
|
Loading…
Add table
Reference in a new issue