Merge pull request #73 from BlueCocoa/patch-1

in case of newline at the end of userlist file
This commit is contained in:
Min RK 2018-09-03 14:43:59 +02:00 committed by GitHub
commit 16a970ec6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,7 +78,9 @@ with open(os.path.join(pwd, 'userlist')) as f:
if not line:
continue
parts = line.split()
name = parts[0]
whitelist.add(name)
if len(parts) > 1 and parts[1] == 'admin':
admin.add(name)
# 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':
admin.add(name)