-
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.
genexis_solt33_telnet support (#3556)
Co-authored-by: Iliya Iliev <iliya.iliev@x3me.net> Co-authored-by: Ilia Iliev <bsdemon@gmail.com>
- Loading branch information
1 parent
06e8b42
commit d5fbf98
Showing
4 changed files
with
39 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.genexis.genexis_solt33 import GenexisSOLT33Telnet | ||
|
||
__all__ = ["GenexisSOLT33Telnet"] |
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,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 |
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