1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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:
Peter Sprygada 2016-10-02 16:47:22 -04:00 committed by GitHub
parent 50c445c356
commit b0cd624aef

View file

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