diff --git a/networking_generic_switch/devices/netmiko_devices/fake.py b/networking_generic_switch/devices/netmiko_devices/fake.py index b754cd08..b939b50a 100644 --- a/networking_generic_switch/devices/netmiko_devices/fake.py +++ b/networking_generic_switch/devices/netmiko_devices/fake.py @@ -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) diff --git a/networking_generic_switch/devices/netmiko_devices/sonic.py b/networking_generic_switch/devices/netmiko_devices/sonic.py index 7a78c80a..f1754ac5 100644 --- a/networking_generic_switch/devices/netmiko_devices/sonic.py +++ b/networking_generic_switch/devices/netmiko_devices/sonic.py @@ -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) diff --git a/setup.cfg b/setup.cfg index 0356c921..0f9d9ffe 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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