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 fd6e45bc75)
pull/54918/head
Chris Van Heuveln 6 years ago committed by Toshio Kuratomi
parent e6baa85517
commit 7dcfa2c45c

@ -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

Loading…
Cancel
Save