Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def send_config_set(self, config_commands, cmd_verify):
if self.device.ngs_config.get('ngs_fake_failure_prob'):
failure_prob = self.device.ngs_config['ngs_fake_failure_prob']
if random.random() < float(failure_prob):
raise Exception("Random failure!")
raise Exception("Random failure!") # noqa

for cmd in config_commands:
LOG.info("%s", cmd)
Expand Down
24 changes: 24 additions & 0 deletions networking_generic_switch/devices/netmiko_devices/sonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,27 @@ def send_config_set(self, net_connect, cmd_set):
return net_connect.send_config_set(config_commands=cmd_set,
cmd_verify=False,
exit_config_mode=False)


class DellEnterpriseSonic(Sonic):
"""Netmiko device driver for Dell Enterprise switches.

Developed against SONiC-OS-4.2.3-Edge_Standard.

This driver must be used with the switch set to
standard or standard-extended naming mode. Do
not use the default setting of native.
"""

def send_config_set(self, net_connect, cmd_set):
# Netmiko tries to use 'sudo -s' to open a root shell
# which doesn't work. It fails with:
# FATAL: root cannot launch CLI
net_connect.config_mode(config_command='sudo -i')

# Don't exit configuration mode, as config save requires
# root permissions.
# Verify commands have run before moving on
return net_connect.send_config_set(config_commands=cmd_set,
cmd_verify=True,
exit_config_mode=False)
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ generic_switch.devices =
netmiko_cumulus = networking_generic_switch.devices.netmiko_devices.cumulus:Cumulus
netmiko_cumulus_nvue = networking_generic_switch.devices.netmiko_devices.cumulus:CumulusNVUE
netmiko_sonic = networking_generic_switch.devices.netmiko_devices.sonic:Sonic
netmiko_dell_enterprise_sonic = networking_generic_switch.devices.netmiko_devices.sonic:DellEnterpriseSonic
netmiko_nokia_srl = networking_generic_switch.devices.netmiko_devices.nokia:NokiaSRL
netmiko_pluribus = networking_generic_switch.devices.netmiko_devices.pluribus:Pluribus
netmiko_aruba_os = networking_generic_switch.devices.netmiko_devices.aruba:ArubaOSCX
Expand Down