mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-19 16:03:00 +00:00
system_user_exists and add_system_user are static methods
This commit is contained in:
@@ -100,7 +100,8 @@ class LocalAuthenticator(Authenticator):
|
|||||||
|
|
||||||
super(LocalAuthenticator, self).add_user(user)
|
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"""
|
"""Check if the user exists on the system"""
|
||||||
try:
|
try:
|
||||||
pwd.getpwnam(user.name)
|
pwd.getpwnam(user.name)
|
||||||
@@ -109,6 +110,7 @@ class LocalAuthenticator(Authenticator):
|
|||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
def add_system_user(user):
|
def add_system_user(user):
|
||||||
"""Create a new *ix user on the system. Works on FreeBSD and Linux, at least."""
|
"""Create a new *ix user on the system. Works on FreeBSD and Linux, at least."""
|
||||||
name = user.name
|
name = user.name
|
||||||
|
Reference in New Issue
Block a user