From b0bc491006161bb1317c920ad915a1bcac78b3b2 Mon Sep 17 00:00:00 2001 From: Joshua Robinson <51381009+Gatorjosh14@users.noreply.github.com> Date: Thu, 26 Oct 2023 14:21:55 -0400 Subject: [PATCH] attempting to fix dependency issues --- netmiko/__init__.py | 2 ++ netmiko/base_connection.py | 4 ++-- netmiko/telnet_proxy.py | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/netmiko/__init__.py b/netmiko/__init__.py index a15a27602..0d2f6a225 100644 --- a/netmiko/__init__.py +++ b/netmiko/__init__.py @@ -61,6 +61,7 @@ def check_python_version(): # type: ignore from netmiko.ssh_autodetect import SSHDetect # noqa from netmiko.base_connection import BaseConnection # noqa from netmiko.scp_functions import file_transfer, progress_bar # noqa +from netmiko.telnet_proxy import TelnetProxy #noqa # Alternate naming Netmiko = ConnectHandler @@ -90,6 +91,7 @@ def check_python_version(): # type: ignore "Netmiko", "file_transfer", "progress_bar", + "TelnetProxy", ) # Cisco cntl-shift-six sequence diff --git a/netmiko/base_connection.py b/netmiko/base_connection.py index 5e2b13a55..585d7d060 100644 --- a/netmiko/base_connection.py +++ b/netmiko/base_connection.py @@ -28,7 +28,6 @@ import re import socket import telnetlib -import telnet_proxy import time from collections import deque from os import path @@ -62,6 +61,7 @@ calc_old_timeout, ) from netmiko.utilities import m_exec_time # noqa +from netmiko.telnet_proxy import TelnetProxy if TYPE_CHECKING: from os import PathLike @@ -1090,7 +1090,7 @@ def establish_connection(self, width: int = 511, height: int = 1000) -> None: self.channel: Channel if self.protocol == "telnet": if self.sock: - self.remote_conn = telnet_proxy.Telnet( + self.remote_conn = TelnetProxy( self.host, port=self.port, timeout=self.timeout, diff --git a/netmiko/telnet_proxy.py b/netmiko/telnet_proxy.py index 2357793bf..4a55d2aa9 100644 --- a/netmiko/telnet_proxy.py +++ b/netmiko/telnet_proxy.py @@ -5,8 +5,7 @@ __all__ = ["Telnet"] - -class Telnet(telnetlib.Telnet): +class TelnetProxy(telnetlib.Telnet): def __init__( self, host=None, port=0, timeout=socket._GLOBAL_DEFAULT_TIMEOUT, proxy_dict=None ):