Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dell OS9: bypass netmiko save_config #19

Merged
merged 1 commit into from
Sep 15, 2023
Merged
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
20 changes: 20 additions & 0 deletions networking_generic_switch/devices/netmiko_devices/dell.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

from networking_generic_switch import exceptions as exc
from networking_generic_switch.devices import netmiko_devices
from oslo_log import log as logging
LOG = logging.getLogger(__name__)


class DellOS10(netmiko_devices.NetmikoSwitch):
Expand Down Expand Up @@ -117,6 +119,24 @@ class DellNos(netmiko_devices.NetmikoSwitch):
'exit',
)

SAVE_CONFIGURATION = (
"write memory",
)

# override method used in netmiko
def save_configuration(self, net_connect):
if self.SAVE_CONFIGURATION:
for cmd in self.SAVE_CONFIGURATION:
net_connect.send_command(cmd)
else:
LOG.warning("Saving config is not supported for %s,"
" all changes will be lost after switch"
" reboot", self.config['device_type'])


ERROR_MSG_PATTERNS = (
re.compile(r'Error: The source file does not exist.'),
)

class DellPowerConnect(netmiko_devices.NetmikoSwitch):
"""Netmiko device driver for Dell PowerConnect switches."""
Expand Down