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 @staticmethod
def system_user_exists(user): def system_user_exists(user):
"""Check if the user exists on the system""" """Check if the user exists on the system"""
import pwd
try: try:
pwd.getpwnam(user.name) getpwnam(user.name)
except KeyError: except KeyError:
return False return False
else: else: