-
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.
Merge branch 'develop' of https://github.com/dannywade/netmiko into d…
…evelop
- Loading branch information
Showing
11 changed files
with
163 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from netmiko.maipu.maipu import MaipuSSH | ||
from netmiko.maipu.maipu import MaipuTelnet | ||
|
||
__all__ = ["MaipuSSH", "MaipuTelnet"] |
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,35 @@ | ||
import time | ||
|
||
from netmiko.cisco_base_connection import CiscoBaseConnection | ||
|
||
|
||
class MaipuBase(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="more off") | ||
# Clear the read buffer | ||
time.sleep(0.3 * self.global_delay_factor) | ||
self.clear_buffer() | ||
|
||
def save_config( | ||
self, cmd: str = "write", confirm: bool = False, confirm_response: str = "" | ||
) -> str: | ||
"""Saves Config Using Copy Run Start""" | ||
return super().save_config( | ||
cmd=cmd, confirm=confirm, confirm_response=confirm_response | ||
) | ||
|
||
|
||
class MaipuSSH(MaipuBase): | ||
"""MAIPU SSH driver""" | ||
|
||
pass | ||
|
||
|
||
class MaipuTelnet(MaipuBase): | ||
"""MAIPU telnet driver""" | ||
|
||
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
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