Use a set to avoid duplicates

This commit is contained in:
twangboy 2018-08-28 12:06:16 -06:00
parent dfa3861352
commit e426459260
No known key found for this signature in database
GPG key ID: 93FF3BDEB278C9EB

View file

@ -467,7 +467,8 @@ def list_users():
salt '*' user.list_users
'''
return sorted([user.pw_name for user in pwd.getpwall()])
# Use a set to not allow duplicates
return sorted(set(user.pw_name for user in pwd.getpwall()))
def rename(name, new_name):