Change get-group-users to a simpler implementation

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Joseph Nuthalapati authored and James Valleroy committed 2018-07-04 08:28:51 -04:00
1 parent 1a095564b0
commit a50b40ee56
2 files changed
+19 -17

No files matched your search

+5 -6
View File
@@ -111,9 +111,8 @@ def get_last_admin_user():
""" Check if there is only one admin user
if yes return its name else return None
"""
admin_users = actions.superuser_run('users',
['get-group-users','admin']
).strip().split('\n')
if len(admin_users) > 1:
return None
return admin_users[0]
admin_users = actions.superuser_run(
'users', ['get-group-users', 'admin']).strip().split('\n')
if len(admin_users) == 1:
return admin_users[0]
return None