in case of newline at the end of userlist file

It's a habit for some developers to append a newline at the end of the file, but line 82 did not take this into consideration. And the consequence is that JupyterHub would keep restarting.
This commit is contained in:
Cocoa Oikawa 2018-07-05 15:20:50 +08:00 committed by GitHub
parent 1baac27d90
commit 5fc9d78a1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,6 +78,8 @@ with open(os.path.join(pwd, 'userlist')) as f:
if not line:
continue
parts = line.split()
# in case of newline at the end of userlist file
if len(parts) >= 1:
name = parts[0]
whitelist.add(name)
if len(parts) > 1 and parts[1] == 'admin':