-
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.
Co-authored-by: Daniel Bremer <[email protected]>
- Loading branch information
Showing
4 changed files
with
37 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
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.vertiv.vertiv_mph_ssh import VertivMPHSSH | ||
|
||
__all__ = ["VertivMPHSSH"] |
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.no_enable import NoEnable | ||
from netmiko.no_config import NoConfig | ||
from netmiko.cisco_base_connection import CiscoSSHConnection | ||
|
||
|
||
class VertivMPHBase(NoEnable, NoConfig, CiscoSSHConnection): | ||
""" | ||
Support for Vertiv MPH Power Distribution Units. | ||
Should work with any Vertiv Device with an RPC2 module. | ||
""" | ||
|
||
def session_preparation(self) -> None: | ||
"""Prepare the session after the connection has been established.""" | ||
# self.ansi_escape_codes = True | ||
self._test_channel_read(pattern=r"cli->") | ||
self.set_base_prompt() | ||
|
||
def save_config( | ||
self, cmd: str = "save", confirm: bool = False, confirm_response: str = "" | ||
) -> str: | ||
"""Saves configuration.""" | ||
return super().save_config( | ||
cmd=cmd, confirm=confirm, confirm_response=confirm_response | ||
) | ||
|
||
def cleanup(self, command: str = "logout") -> None: | ||
return super().cleanup(command=command) | ||
|
||
|
||
class VertivMPHSSH(VertivMPHBase): | ||
pass |