diff --git a/PLATFORMS.md b/PLATFORMS.md index c8486debe..19e6291be 100644 --- a/PLATFORMS.md +++ b/PLATFORMS.md @@ -279,3 +279,4 @@ - juniper_junos - linux - nokia_sros + diff --git a/license-dependencies.txt b/license-dependencies.txt index b93a2158d..aedb5db56 100644 --- a/license-dependencies.txt +++ b/license-dependencies.txt @@ -10,7 +10,6 @@ Name Version License ------------- ------- ------- paramiko 2.10.4 GNU Library or Lesser General Public License (LGPL) scp 0.14.4 GNU Library or Lesser General Public License (LGPL) -tenacity 8.0.1 Apache Software License ntc-templates 3.0.0 Apache Software License pyserial 3.5 BSD License PyYAML 6.0 MIT License diff --git a/netmiko/audiocode/audiocode_ssh.py b/netmiko/audiocode/audiocode_ssh.py index 06ec4780e..10074ef73 100644 --- a/netmiko/audiocode/audiocode_ssh.py +++ b/netmiko/audiocode/audiocode_ssh.py @@ -372,7 +372,7 @@ def send_config_set( enter_config_mode: bool = True, error_pattern: str = "", terminator: str = r"/.*>", - bypass_commands: str = None, + bypass_commands: Optional[str] = None, ) -> str: return super().send_config_set( @@ -447,7 +447,7 @@ def _enable_paging( delay_factor: Optional[float] = 0.5, ) -> str: """Not supported""" - pass + return "" def strip_command(self, command_string: str, output: str) -> str: # Support for Audiocode_Shell. diff --git a/netmiko/base_connection.py b/netmiko/base_connection.py index f00241b22..a3d78da92 100644 --- a/netmiko/base_connection.py +++ b/netmiko/base_connection.py @@ -39,7 +39,6 @@ import paramiko import serial -from tenacity import retry, stop_after_attempt, wait_exponential import warnings from netmiko import log @@ -1294,12 +1293,6 @@ def set_terminal_width( output = self.read_until_prompt() return output - # Retry by sleeping .33 and then double sleep until 5 attempts (.33, .66, 1.32, etc) - @retry( - wait=wait_exponential(multiplier=0.33, min=0, max=5), - stop=stop_after_attempt(5), - reraise=True, - ) def set_base_prompt( self, pri_prompt_terminator: str = "#", diff --git a/netmiko/nokia/nokia_sros.py b/netmiko/nokia/nokia_sros.py index 5ddda2b9b..f56daeafd 100644 --- a/netmiko/nokia/nokia_sros.py +++ b/netmiko/nokia/nokia_sros.py @@ -175,13 +175,13 @@ def save_config(self, *args: Any, **kwargs: Any) -> str: def send_config_set( self, config_commands: Union[str, Sequence[str], Iterator[str], TextIO, None] = None, - exit_config_mode: bool = None, + exit_config_mode: bool = True, **kwargs: Any, ) -> str: """Model driven CLI requires you not exit from configuration mode.""" - if exit_config_mode is None: - # Set to False if model-driven CLI - exit_config_mode = False if "@" in self.base_prompt else True + # Set to False if model-driven CLI + if "@" in self.base_prompt: + exit_config_mode = False return super().send_config_set( config_commands=config_commands, exit_config_mode=exit_config_mode, **kwargs ) diff --git a/netmiko/session_log.py b/netmiko/session_log.py index 77c82c4cb..9ead1316c 100644 --- a/netmiko/session_log.py +++ b/netmiko/session_log.py @@ -10,7 +10,7 @@ def __init__( buffered_io: Optional[io.BufferedIOBase] = None, file_mode: str = "write", file_encoding: str = "utf-8", - no_log: Dict[str, Any] = None, + no_log: Optional[Dict[str, Any]] = None, record_writes: bool = False, ) -> None: if no_log is None: diff --git a/netmiko/sixwind/sixwind_os.py b/netmiko/sixwind/sixwind_os.py index da3f55a4c..8fdaa37ea 100644 --- a/netmiko/sixwind/sixwind_os.py +++ b/netmiko/sixwind/sixwind_os.py @@ -18,7 +18,7 @@ def session_preparation(self) -> None: def disable_paging(self, *args: Any, **kwargs: Any) -> str: """6WIND requires no-pager at the end of command, not implemented at this time.""" - pass + return "" def set_base_prompt( self, diff --git a/netmiko/terminal_server/terminal_server.py b/netmiko/terminal_server/terminal_server.py index f059b6153..b8335b045 100644 --- a/netmiko/terminal_server/terminal_server.py +++ b/netmiko/terminal_server/terminal_server.py @@ -27,7 +27,7 @@ class TerminalServerTelnet(TerminalServer): def telnet_login(self, *args: Any, **kwargs: Any) -> str: # Disable automatic handling of username and password when using terminal server driver - pass + return "" def std_login(self, *args: Any, **kwargs: Any) -> str: return super().telnet_login(*args, **kwargs) diff --git a/netmiko/watchguard/fireware_ssh.py b/netmiko/watchguard/fireware_ssh.py index 1ef7585cb..b94f120c1 100644 --- a/netmiko/watchguard/fireware_ssh.py +++ b/netmiko/watchguard/fireware_ssh.py @@ -41,4 +41,4 @@ def exit_config_mode(self, exit_config: str = "exit", pattern: str = "#") -> str def save_config(self, *args: Any, **kwargs: Any) -> str: """No save config on Watchguard.""" - pass + return "" diff --git a/requirements-dev.txt b/requirements-dev.txt index ec90032a4..05cc1dead 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,6 @@ black==22.3.0 -mypy==0.961 -mypy-extensions==0.4.3 +mypy==1.0.0 +mypy-extensions==1.0.0 PyYAML==5.4.1 pytest==7.1.2 # Issue with build failure on pyflakes 2.5.0 diff --git a/setup.py b/setup.py index 57234b661..8fbacf7bc 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,6 @@ def find_version(*file_paths): "setuptools>=38.4.0", "paramiko>=2.7.2", "scp>=0.13.3", - "tenacity", "pyyaml>=5.3", "textfsm", "ntc-templates>=2.0.0",