Switch to existing getpwnam function

To be honest, `getgrouplist`, `getpwnam`, and `getgrnam` should be static methods in LocalAuthenticator
This commit is contained in:
Will Starms
2018-11-13 13:53:46 -06:00
parent 767dce29f4
commit f2ae3af90e

View File

@@ -601,9 +601,8 @@ class LocalAuthenticator(Authenticator):
@staticmethod
def system_user_exists(user):
"""Check if the user exists on the system"""
import pwd
try:
pwd.getpwnam(user.name)
getpwnam(user.name)
except KeyError:
return False
else: