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:
Peter Sprygada 2016-09-30 15:00:10 -04:00 committed by GitHub
parent d88025f0cb
commit 9faf56a345

View file

@ -60,7 +60,10 @@ class NxapiConfigMixin(object):
self.execute(['no checkpoint %s' % checkpoint])
def save_config(self, **kwargs):
self.execute(['copy running-config startup-config'])
try:
self.execute(['copy running-config startup-config'], output='text')
except TypeError:
self.execute(['copy running-config startup-config'])
def load_checkpoint(self, checkpoint):
try: