fixes issue with run_commands raising error (#17861)

The junos run_commands() method should raise an error when an RpcError is
returned but didn't when using display=text.  This fixes that error
pull/17864/head
Peter Sprygada 8 years ago committed by GitHub
parent 50c445c356
commit b0cd624aef

@ -139,6 +139,9 @@ class Netconf(object):
responses[index] = xml_to_json(responses[index]) responses[index] = xml_to_json(responses[index])
elif cmd.args.get('command_type') == 'rpc': elif cmd.args.get('command_type') == 'rpc':
responses[index] = str(responses[index].text).strip() responses[index] = str(responses[index].text).strip()
elif 'RpcError' in responses[index]:
raise NetworkError(responses[index])
return responses return responses

Loading…
Cancel
Save