From 7dcfa2c45c7f24b55c81c448cfd3ef7b4cb3bbbe Mon Sep 17 00:00:00 2001 From: Chris Van Heuveln Date: Thu, 7 Mar 2019 08:15:26 -0500 Subject: [PATCH] nxos_user: fails to remove usernames with embedded '\' (#53149) Example: username ucs-DOMAIN\\x password 0 foo Found by `common/sanity` test. (cherry picked from commit fd6e45bc75d8ed51ac7bed2879ed23ea24d39c90) --- lib/ansible/modules/network/nxos/nxos_user.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ansible/modules/network/nxos/nxos_user.py b/lib/ansible/modules/network/nxos/nxos_user.py index 9c8de1e62cd..8f7aa28830b 100644 --- a/lib/ansible/modules/network/nxos/nxos_user.py +++ b/lib/ansible/modules/network/nxos/nxos_user.py @@ -360,6 +360,7 @@ def main(): have_users = [x['name'] for x in have] for item in set(have_users).difference(want_users): if item != 'admin': + item = item.replace("\\", "\\\\") commands.append('no username %s' % item) result['commands'] = commands