|
|
@ -201,20 +201,14 @@ class Nxapi(NxapiConfigMixin):
|
|
|
|
|
|
|
|
|
|
|
|
for cmd in commands:
|
|
|
|
for cmd in commands:
|
|
|
|
if output and output != cmd.output:
|
|
|
|
if output and output != cmd.output:
|
|
|
|
try:
|
|
|
|
responses.extend(self.execute(cmds, output=output))
|
|
|
|
responses.extend(self.execute(cmds, output=output))
|
|
|
|
|
|
|
|
except ValueError:
|
|
|
|
|
|
|
|
responses.extend(self.execute(cmds))
|
|
|
|
|
|
|
|
cmds = list()
|
|
|
|
cmds = list()
|
|
|
|
|
|
|
|
|
|
|
|
output = cmd.output
|
|
|
|
output = cmd.output
|
|
|
|
cmds.append(str(cmd))
|
|
|
|
cmds.append(str(cmd))
|
|
|
|
|
|
|
|
|
|
|
|
if cmds:
|
|
|
|
if cmds:
|
|
|
|
try:
|
|
|
|
responses.extend(self.execute(cmds, output=output))
|
|
|
|
responses.extend(self.execute(cmds, output=output))
|
|
|
|
|
|
|
|
except ValueError:
|
|
|
|
|
|
|
|
responses.extend(self.execute(cmds))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return responses
|
|
|
|
return responses
|
|
|
|
|
|
|
|
|
|
|
@ -223,10 +217,7 @@ class Nxapi(NxapiConfigMixin):
|
|
|
|
|
|
|
|
|
|
|
|
def configure(self, commands):
|
|
|
|
def configure(self, commands):
|
|
|
|
commands = to_list(commands)
|
|
|
|
commands = to_list(commands)
|
|
|
|
try:
|
|
|
|
return self.execute(commands, output='config')
|
|
|
|
return self.execute(commands, output='config')
|
|
|
|
|
|
|
|
except ValueError:
|
|
|
|
|
|
|
|
return self.execute(commands)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _jsonify(self, data):
|
|
|
|
def _jsonify(self, data):
|
|
|
|
for encoding in ("utf-8", "latin-1"):
|
|
|
|
for encoding in ("utf-8", "latin-1"):
|
|
|
|