-
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: sandyw777 <[email protected]> Co-authored-by: puffc <[email protected]>
- Loading branch information
1 parent
353db2d
commit 5854897
Showing
9 changed files
with
101 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
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.supermicro.smci_smis import SmciSwitchSmisTelnet, SmciSwitchSmisSSH | ||
|
||
__all__ = ["SmciSwitchSmisSSH", "SmciSwitchSmisTelnet"] |
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,44 @@ | ||
from netmiko.cisco_base_connection import CiscoBaseConnection | ||
import time | ||
|
||
|
||
class SmciSwitchSmisBase(CiscoBaseConnection): | ||
def session_preparation(self): | ||
"""Prepare the session after the connection has been established.""" | ||
self._test_channel_read(pattern=r"[>#]") | ||
self.set_base_prompt() | ||
self.config_mode() | ||
self.disable_paging(command="set cli pagination off") | ||
self.set_terminal_width(command="terminal width 511") | ||
self.exit_config_mode() | ||
# Clear the read buffer | ||
time.sleep(0.3 * self.global_delay_factor) | ||
self.clear_buffer() | ||
|
||
def check_enable_mode(self, check_string="#"): | ||
"""Check if in enable mode. Return boolean.""" | ||
return super().check_enable_mode(check_string=check_string) | ||
|
||
def enable(self, *args, **kwargs): | ||
"""Supermicro switch does not support enable-mode command""" | ||
return "" | ||
|
||
def exit_enable_mode(self, *args, **kwargs): | ||
"""Supermicro switch does not support enable-mode command""" | ||
return "" | ||
|
||
def save_config( | ||
self, cmd="write startup-config", confirm=False, confirm_response="" | ||
): | ||
"""Save config""" | ||
return super().save_config( | ||
cmd=cmd, confirm=confirm, confirm_response=confirm_response | ||
) | ||
|
||
|
||
class SmciSwitchSmisSSH(SmciSwitchSmisBase): | ||
pass | ||
|
||
|
||
class SmciSwitchSmisTelnet(SmciSwitchSmisBase): | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
RETURN_CODE=0 | ||
|
||
# Exit on the first test failure and set RETURN_CODE = 1 | ||
echo "Starting tests...good luck:" \ | ||
&& py.test -v test_netmiko_show.py --test_device supermicro_nos \ | ||
&& py.test -v test_netmiko_config.py --test_device supermicro_nos \ | ||
|| RETURN_CODE=1 | ||
|
||
exit $RETURN_CODE |