Skip to content

Commit

Permalink
Updates for Hillstone StoneOS driver
Browse files Browse the repository at this point in the history
  • Loading branch information
ktbyers committed Jan 13, 2023
1 parent 9ab333c commit 565c825
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
6 changes: 1 addition & 5 deletions netmiko/cisco_base_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ def exit_enable_mode(self, exit_command: str = "disable") -> str:
def check_config_mode(
self, check_string: str = ")#", pattern: str = "", force_regex: bool = False
) -> bool:
"""
Checks if the device is in configuration mode or not.
Cisco IOS devices abbreviate the prompt at 20 chars in config mode
"""
"""Checks if the device is in configuration mode or not."""
return super().check_config_mode(
check_string=check_string, pattern=pattern, force_regex=force_regex
)
Expand Down
4 changes: 2 additions & 2 deletions netmiko/hillstone/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from netmiko.hillstone.hillstone import hillstoneSSH
from netmiko.hillstone.hillstone import HillstoneStoneosSSH

__all__ = ["hillstoneSSH"]
__all__ = ["HillstoneStoneosSSH"]
9 changes: 2 additions & 7 deletions netmiko/hillstone/hillstone.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import time
from netmiko.no_enable import NoEnable
from netmiko.cisco_base_connection import CiscoBaseConnection


class hillstoneBase(NoEnable,CiscoBaseConnection):
class HillstoneStoneosBase(NoEnable, CiscoBaseConnection):
def session_preparation(self) -> None:
"""Prepare the session after the connection has been established."""
self._test_channel_read(pattern=r"#")
self.set_base_prompt()
# self.enable()
self.disable_paging(command="terminal length 0")
# Clear the read buffer
time.sleep(0.3 * self.global_delay_factor)
self.clear_buffer()

def config_mode(
self,
Expand Down Expand Up @@ -42,5 +37,5 @@ def save_config(
)


class hillstoneSSH(hillstoneBase):
class HillstoneStoneosSSH(HillstoneStoneosBase):
pass
4 changes: 2 additions & 2 deletions netmiko/ssh_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
from netmiko.supermicro import SmciSwitchSmisSSH
from netmiko.supermicro import SmciSwitchSmisTelnet
from netmiko.zyxel import ZyxelSSH
from netmiko.hillstone import hillstoneSSH
from netmiko.hillstone import HillstoneStoneosSSH

if TYPE_CHECKING:
from netmiko.base_connection import BaseConnection
Expand Down Expand Up @@ -256,7 +256,7 @@
"zte_zxros": ZteZxrosSSH,
"yamaha": YamahaSSH,
"zyxel_os": ZyxelSSH,
"hillstone": hillstoneSSH,
"hillstone_stoneos": HillstoneStoneosSSH,
}

FILE_TRANSFER_MAP = {
Expand Down

0 comments on commit 565c825

Please sign in to comment.