fixes issue when calling save_config() and transport is nxapi (#17835)
An unhandled exeception is raised with using nxapi transport and setting the save argument to true. This fix will allow the configuration to be saved regardless of the transport. fixes ansible/ansible-modules-core#5094
This commit is contained in:
parent
d88025f0cb
commit
9faf56a345
1 changed files with 4 additions and 1 deletions
|
@ -60,6 +60,9 @@ class NxapiConfigMixin(object):
|
||||||
self.execute(['no checkpoint %s' % checkpoint])
|
self.execute(['no checkpoint %s' % checkpoint])
|
||||||
|
|
||||||
def save_config(self, **kwargs):
|
def save_config(self, **kwargs):
|
||||||
|
try:
|
||||||
|
self.execute(['copy running-config startup-config'], output='text')
|
||||||
|
except TypeError:
|
||||||
self.execute(['copy running-config startup-config'])
|
self.execute(['copy running-config startup-config'])
|
||||||
|
|
||||||
def load_checkpoint(self, checkpoint):
|
def load_checkpoint(self, checkpoint):
|
||||||
|
|
Loading…
Reference in a new issue