system_user_exists and add_system_user are static methods

This commit is contained in:
MinRK
2014-09-25 14:57:25 -07:00
parent e2f12f7071
commit e07affe28f

View File

@@ -100,7 +100,8 @@ class LocalAuthenticator(Authenticator):
super(LocalAuthenticator, self).add_user(user)
def system_user_exists(self, user):
@staticmethod
def system_user_exists(user):
"""Check if the user exists on the system"""
try:
pwd.getpwnam(user.name)
@@ -109,6 +110,7 @@ class LocalAuthenticator(Authenticator):
else:
return True
@staticmethod
def add_system_user(user):
"""Create a new *ix user on the system. Works on FreeBSD and Linux, at least."""
name = user.name