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
This commit is contained in:
parent
50c445c356
commit
b0cd624aef
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue