From ac169f5ffd43f83b292bfe13e1a5815b1112dc5c Mon Sep 17 00:00:00 2001 From: Mike Wiebe Date: Fri, 16 Feb 2018 11:04:26 -0500 Subject: [PATCH] Fix structured output bug (#36193) --- lib/ansible/modules/network/nxos/nxos_user.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/network/nxos/nxos_user.py b/lib/ansible/modules/network/nxos/nxos_user.py index 8d6c6867de..392397d447 100644 --- a/lib/ansible/modules/network/nxos/nxos_user.py +++ b/lib/ansible/modules/network/nxos/nxos_user.py @@ -221,7 +221,10 @@ def parse_password(data): def parse_roles(data): - configured_roles = data.get('TABLE_role')['ROW_role'] + configured_roles = None + if 'TABLE_role' in data: + configured_roles = data.get('TABLE_role')['ROW_role'] + roles = list() if configured_roles: for item in to_list(configured_roles):