-
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.
Loading status checks…
Merge branch 'develop' into evilmonkey19-huawei_smartax_improve_closing
Showing
8 changed files
with
142 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from netmiko.optilink.op_eolt9702 import OptilinkEOLT9702Telnet | ||
from netmiko.optilink.op_eolt11444 import OptilinkEOLT11444Telnet | ||
|
||
__all__ = [ | ||
"OptilinkEOLT11444Telnet", | ||
"OptilinkEOLT9702Telnet", | ||
] |
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,36 @@ | ||
from netmiko.cisco_base_connection import CiscoBaseConnection | ||
|
||
|
||
class OptilinkEOLT11444Base(CiscoBaseConnection): | ||
""" | ||
Optilink EOLT 11444 | ||
Optilink EOLT 11448 | ||
""" | ||
|
||
def session_preparation(self) -> None: | ||
self._test_channel_read(pattern=r"[>#]") | ||
self.set_base_prompt() | ||
self.enable() | ||
self.disable_paging() | ||
self.clear_buffer() | ||
self.exit_enable_mode() | ||
|
||
def config_mode( | ||
self, | ||
config_command: str = "configure", | ||
pattern: str = "", | ||
re_flags: int = 0, | ||
) -> str: | ||
"""Enter into configuration mode.""" | ||
return super().config_mode( | ||
config_command=config_command, pattern=pattern, re_flags=re_flags | ||
) | ||
|
||
|
||
class OptilinkEOLT11444Telnet(OptilinkEOLT11444Base): | ||
""" | ||
Optilink EOLT 11444 telnet driver | ||
Optilink EOLT 11448 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
from netmiko.cisco_base_connection import CiscoBaseConnection | ||
|
||
|
||
class OptilinkEOLT9702Base(CiscoBaseConnection): | ||
""" | ||
Optilink EOLT 9702-8P2AB | ||
Optilink EOLT 9702-4P | ||
""" | ||
|
||
def session_preparation(self) -> None: | ||
self._test_channel_read(pattern=r"[>#]") | ||
self.set_base_prompt() | ||
self.enable() | ||
self.config_mode() | ||
self.send_command("vty output show-all") | ||
self.exit_config_mode() | ||
self.exit_enable_mode() | ||
|
||
def config_mode( | ||
self, | ||
config_command: str = "config", | ||
pattern: str = "", | ||
re_flags: int = 0, | ||
) -> str: | ||
"""Enter into configuration mode.""" | ||
return super().config_mode( | ||
config_command=config_command, pattern=pattern, re_flags=re_flags | ||
) | ||
|
||
def exit_enable_mode(self, exit_command: str = "exit") -> str: | ||
"""Exit from enable mode.""" | ||
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"OP_OLT>") | ||
if self.check_enable_mode(): | ||
raise ValueError("Failed to exit enable mode.") | ||
return output | ||
|
||
def exit_config_mode(self, exit_config: str = "exit", pattern: str = r"#.*") -> str: | ||
"""Exit from configuration mode.""" | ||
return super().exit_config_mode(exit_config=exit_config, pattern=pattern) | ||
|
||
|
||
class OptilinkEOLT9702Telnet(OptilinkEOLT9702Base): | ||
""" | ||
Optilink EOLT 9702-8P2AB telnet driver | ||
Optilink EOLT 9702-4P 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