Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
fixed --add-ignored-user so it won't add any blank items to the array
Browse files Browse the repository at this point in the history
  • Loading branch information
chilcote committed Mar 18, 2016
1 parent 3cf49af commit 3c28310
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkgroot/usr/local/outset/outset
Original file line number Diff line number Diff line change
Expand Up @@ -415,12 +415,13 @@ def main():
if os.getuid() != 0:
logging.error('Must be root to add users to ignored_users')
exit(1)
users_to_add = args.add_ignored_user
users_to_add.extend(ignored_users)
users_to_add = [i for i in args.add_ignored_user if i != '']
if users_to_add:
users_to_ignore = list(set(users_to_add))
prefs['ignored_users'] = users_to_ignore
FoundationPlist.writePlist(prefs, outset_preferences)
users_to_add.extend(ignored_users)
users_to_ignore = list(set(users_to_add)) if users_to_add else None
if users_to_ignore:
prefs['ignored_users'] = users_to_ignore
FoundationPlist.writePlist(prefs, outset_preferences)

if args.remove_ignored_user:
if os.getuid() != 0:
Expand Down

0 comments on commit 3c28310

Please sign in to comment.