Skip to content

Commit

Permalink
Add Digi TransPort Router Support (#3310)
Browse files Browse the repository at this point in the history
Co-authored-by: tbotnz <[email protected]>
  • Loading branch information
ktbyers and tbotnz authored Oct 17, 2023
1 parent e2135e7 commit bf7a492
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 0 deletions.
3 changes: 3 additions & 0 deletions PLATFORMS.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
- Huawei SmartAX
- IP Infusion OcNOS
- Juniper ScreenOS
- Maipu
- MikroTik RouterOS
- MikroTik SwitchOS
- NetApp cDOT
Expand Down Expand Up @@ -83,6 +84,7 @@
- Coriant
- Dell OS6
- Dell EMC Isilon
- Digi TransPort Routers
- Eltex
- Enterasys
- Endace
Expand Down Expand Up @@ -162,6 +164,7 @@
- dell_powerconnect
- dell_sonic
- dlink_ds
- digi_transport
- eltex
- eltex_esr
- endace
Expand Down
3 changes: 3 additions & 0 deletions netmiko/digi/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from netmiko.digi.digi_transport import DigiTransportSSH

__all__ = ["DigiTransportSSH"]
27 changes: 27 additions & 0 deletions netmiko/digi/digi_transport.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""Digi TransPort Routers"""
from typing import Any
from netmiko.no_enable import NoEnable
from netmiko.no_config import NoConfig
from netmiko.cisco_base_connection import CiscoSSHConnection


class DigiTransportBase(NoEnable, NoConfig, CiscoSSHConnection):
def __init__(self, *args: Any, **kwargs: Any) -> None:
default_enter = kwargs.get("default_enter")
kwargs["default_enter"] = "\r\n" if default_enter is None else default_enter
super().__init__(*args, **kwargs)

def save_config(
self,
cmd: str = "config 0 save",
confirm: bool = False,
confirm_response: str = "",
) -> str:
output = self._send_command_str(
command_string=cmd, expect_string="Please wait..."
)
return output


class DigiTransportSSH(DigiTransportBase):
pass
2 changes: 2 additions & 0 deletions netmiko/ssh_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
from netmiko.dell import DellPowerConnectSSH
from netmiko.dell import DellPowerConnectTelnet
from netmiko.dell import DellIsilonSSH
from netmiko.digi import DigiTransportSSH
from netmiko.dlink import DlinkDSTelnet, DlinkDSSSH
from netmiko.eltex import EltexSSH, EltexEsrSSH
from netmiko.endace import EndaceSSH
Expand Down Expand Up @@ -201,6 +202,7 @@
"dell_powerconnect": DellPowerConnectSSH,
"dell_isilon": DellIsilonSSH,
"dlink_ds": DlinkDSSSH,
"digi_transport": DigiTransportSSH,
"endace": EndaceSSH,
"eltex": EltexSSH,
"eltex_esr": EltexEsrSSH,
Expand Down
6 changes: 6 additions & 0 deletions tests/etc/commands.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,11 @@ audiocode_shell:
save_config_response: 'Configuration has been saved'
config_mode_command: "conf" # only use if needed

digi_transport:
version: "type version"
basic: "type config.da0"
extended_output: "type version all"

maipu:
version: "show version"
basic: "show ip interface brief"
Expand Down Expand Up @@ -597,3 +602,4 @@ fiberstore_fsos:
- 'no logging console'
- 'logging buffered severity 3'
config_verification: "show run"

7 changes: 7 additions & 0 deletions tests/etc/responses.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,13 @@ audiocode_shell:
cmd_response_init: "Test_String1"
cmd_response_final: "Test_String2"

digi_transport:
base_prompt: "digi>"
router_prompt: "digi>"
enable_prompt: "digi#"
interface_ip: 192.168.1.33
version_banner: "Ci Version"

maipu:
base_prompt: maipu_sw
router_prompt : maipu_sw>
Expand Down
6 changes: 6 additions & 0 deletions tests/etc/test_devices.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,12 @@ audiocode_shell:
username: TestUser
password: TestPass

digi_transport:
device_type: digi_transport
ip: 192.168.1.33
username: bob
password: bob

maipu:
device_type: maipu
ip: 129.255.27.1
Expand Down

0 comments on commit bf7a492

Please sign in to comment.