-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Digi TransPort Router Support (#3310)
Co-authored-by: tbotnz <[email protected]>
- Loading branch information
Showing
7 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from netmiko.digi.digi_transport import DigiTransportSSH | ||
|
||
__all__ = ["DigiTransportSSH"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters