fix nxos parse response KeyError (#28602)

* fix nxos parse response

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* use get() method instead
This commit is contained in:
Trishna Guha 2017-08-28 16:15:20 -04:00 committed by Nathaniel Case
parent 335e804c0c
commit c36c34ef7e

View file

@ -288,6 +288,7 @@ class Nxapi:
except ValueError:
self._module.fail_json(msg='unable to parse response')
if response['ins_api'].get('outputs'):
output = response['ins_api']['outputs']['output']
for item in to_list(output):
if check_status and item['code'] != '200':