mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 03:10:46 +08:00
fix(bastion): subclass netmiko driver class on Python 3.14
ConnectHandler is a factory function in current Netmiko; subclass the CLASS_MAPPER driver (e.g. ZteZxrosSSH) when wrapping a pre-authenticated Paramiko session. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
088e920f9d
commit
5a00736f23
2 changed files with 21 additions and 2 deletions
|
|
@ -64,6 +64,13 @@ class BastionTemplateTests(unittest.TestCase):
|
|||
"ssh ZTE-FIVIE@ca-admin@114.1.198.1@10.34.145.25",
|
||||
)
|
||||
|
||||
def test_netmiko_driver_class_resolves_zte(self) -> None:
|
||||
from netmiko.zte.zte_zxros import ZteZxrosSSH
|
||||
|
||||
from netx_api.ne_session_factory import _netmiko_driver_class
|
||||
|
||||
self.assertIs(_netmiko_driver_class("zte_zxros_ssh"), ZteZxrosSSH)
|
||||
|
||||
|
||||
class BastionConnectRoutingTests(unittest.TestCase):
|
||||
@patch("netx_api.ne_session_factory._connect_via_bastion")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue