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: if not line:
continue continue
parts = line.split() parts = line.split()
name = parts[0] # in case of newline at the end of userlist file
whitelist.add(name) if len(parts) >= 1:
if len(parts) > 1 and parts[1] == 'admin': name = parts[0]
admin.add(name) whitelist.add(name)
if len(parts) > 1 and parts[1] == 'admin':
admin.add(name)