Skip to content

Commit

Permalink
genexis_solt33_telnet support (#3556)
Browse files Browse the repository at this point in the history
Co-authored-by: Iliya Iliev <iliya.iliev@x3me.net>
Co-authored-by: Ilia Iliev <bsdemon@gmail.com>
  • Loading branch information
3 people authored Jan 6, 2025
1 parent 06e8b42 commit d5fbf98
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
2 changes: 2 additions & 0 deletions PLATFORMS.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
- F5 Linux
- Fortinet
- Garderos GRS
- Genexis Saturn SOLT33
- MRV Communications OptiSwitch
- MRV LX
- Nokia/Alcatel SR-OS
Expand Down Expand Up @@ -280,6 +281,7 @@
- extreme_telnet
- generic_telnet
- generic_termserver_telnet
- genexis_solt33_telnet
- hp_comware_telnet
- hp_procurve_telnet
- huawei_olt_telnet
Expand Down
3 changes: 3 additions & 0 deletions netmiko/genexis/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from netmiko.genexis.genexis_solt33 import GenexisSOLT33Telnet

__all__ = ["GenexisSOLT33Telnet"]
31 changes: 31 additions & 0 deletions netmiko/genexis/genexis_solt33.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from netmiko.cisco_base_connection import CiscoBaseConnection


class GenexisSOLT33Base(CiscoBaseConnection):
def session_preparation(self) -> None:
self._test_channel_read(pattern=r"[>#]")
self.set_base_prompt()
self.enable()
self.config_mode()
cmd = "line width 256"
self.set_terminal_width(command=cmd, pattern=cmd)
self.disable_paging(command="screen-rows per-page 0")
self.clear_buffer()
self.exit_config_mode()
self.exit_enable_mode()

def exit_enable_mode(self, exit_command: str = "exit") -> str:
output = ""
if self.check_enable_mode():
self.write_channel(self.normalize_cmd(exit_command))
self.read_until_pattern(pattern=exit_command)
output += self.read_until_pattern(pattern=r">")
if self.check_enable_mode():
raise ValueError("Failed to exit enable mode.")
return output


class GenexisSOLT33Telnet(GenexisSOLT33Base):
"""Genexis SOLT33 telnet driver"""

pass
5 changes: 3 additions & 2 deletions netmiko/ssh_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
from netmiko.flexvnf import FlexvnfSSH
from netmiko.fortinet import FortinetSSH
from netmiko.garderos import GarderosGrsSSH
from netmiko.genexis import GenexisSOLT33Telnet
from netmiko.hillstone import HillstoneStoneosSSH
from netmiko.hp import HPProcurveSSH, HPProcurveTelnet, HPComwareSSH, HPComwareTelnet
from netmiko.huawei import HuaweiSSH, HuaweiVrpv8SSH, HuaweiTelnet
Expand Down Expand Up @@ -143,7 +144,6 @@
from netmiko.supermicro import SmciSwitchSmisTelnet
from netmiko.zyxel import ZyxelSSH


if TYPE_CHECKING:
from netmiko.base_connection import BaseConnection
from netmiko.scp_handler import BaseFileTransfer
Expand Down Expand Up @@ -350,12 +350,14 @@
CLASS_MAPPER["extreme_netiron_telnet"] = ExtremeNetironTelnet
CLASS_MAPPER["generic_telnet"] = GenericTelnet
CLASS_MAPPER["generic_termserver_telnet"] = TerminalServerTelnet
CLASS_MAPPER["genexis_solt33_telnet"] = GenexisSOLT33Telnet
CLASS_MAPPER["hp_procurve_telnet"] = HPProcurveTelnet
CLASS_MAPPER["hp_comware_telnet"] = HPComwareTelnet
CLASS_MAPPER["huawei_telnet"] = HuaweiTelnet
CLASS_MAPPER["huawei_olt_telnet"] = HuaweiSmartAXSSH
CLASS_MAPPER["ipinfusion_ocnos_telnet"] = IpInfusionOcNOSTelnet
CLASS_MAPPER["juniper_junos_telnet"] = JuniperTelnet
CLASS_MAPPER["maipu_telnet"] = MaipuTelnet
CLASS_MAPPER["nokia_sros_telnet"] = NokiaSrosTelnet
CLASS_MAPPER["oneaccess_oneos_telnet"] = OneaccessOneOSTelnet
CLASS_MAPPER["paloalto_panos_telnet"] = PaloAltoPanosTelnet
Expand All @@ -368,7 +370,6 @@
CLASS_MAPPER["tplink_jetstream_telnet"] = TPLinkJetStreamTelnet
CLASS_MAPPER["yamaha_telnet"] = YamahaTelnet
CLASS_MAPPER["zte_zxros_telnet"] = ZteZxrosTelnet
CLASS_MAPPER["maipu_telnet"] = MaipuTelnet

# Add serial drivers
CLASS_MAPPER["cisco_ios_serial"] = CiscoIosSerial
Expand Down

0 comments on commit d5fbf98

Please sign in to comment.