From 2293252e529d4708c76ed2dc0dc60d7834a3eec9 Mon Sep 17 00:00:00 2001 From: Chip Gwyn Date: Tue, 30 Jan 2018 00:56:54 -0500 Subject: [PATCH] bug-35431 fixed removing encryption from user on subsequent runs of the task (#35433) --- lib/ansible/modules/network/nxos/nxos_snmp_user.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/network/nxos/nxos_snmp_user.py b/lib/ansible/modules/network/nxos/nxos_snmp_user.py index 093d57c597..2978a6767b 100644 --- a/lib/ansible/modules/network/nxos/nxos_snmp_user.py +++ b/lib/ansible/modules/network/nxos/nxos_snmp_user.py @@ -289,9 +289,6 @@ def main(): reset = True proposed['encrypt'] = 'aes-128' - elif encrypt: - proposed['encrypt'] = 'aes-128' - delta = dict(set(proposed.items()).difference(existing.items())) if delta.get('pwd'): @@ -300,6 +297,9 @@ def main(): if delta: delta['group'] = group + if delta and encrypt: + delta['encrypt'] = 'aes-128' + command = config_snmp_user(delta, user, reset, new) commands.append(command)