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):