users: Minor cosmetic refactoring

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2019-08-19 19:38:08 -07:00 committed by James Valleroy
parent b01ac54dd3
commit e1e654554e
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -125,11 +125,11 @@ def register_group(group):
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 there is only one admin user return its name else return None."""
output = actions.superuser_run('users', ['get-group-users', 'admin'])
admin_users = output.strip().split('\n')
if len(admin_users) == 1:
return admin_users[0]
return None