From 3c283102f293f470dce9902ce4280acfe8ef7500 Mon Sep 17 00:00:00 2001 From: Joseph Chilcote Date: Fri, 18 Mar 2016 13:10:47 -0700 Subject: [PATCH] fixed --add-ignored-user so it won't add any blank items to the array --- pkgroot/usr/local/outset/outset | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgroot/usr/local/outset/outset b/pkgroot/usr/local/outset/outset index 7175e92..aa395ff 100755 --- a/pkgroot/usr/local/outset/outset +++ b/pkgroot/usr/local/outset/outset @@ -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: