nxos_user: fails to remove usernames with embedded '\' (#53149)

Example: username ucs-DOMAIN\\x password 0 foo

Found by `common/sanity` test.
This commit is contained in:
Chris Van Heuveln 2019-03-07 08:15:26 -05:00 committed by Trishna Guha
parent 495bd02dbf
commit fd6e45bc75

View file

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