From 69661940e93945925c81edc84dafbf8982a05819 Mon Sep 17 00:00:00 2001
From: Jeremy Jarrell <jjarrell@listhub.com>
Date: Tue, 18 Jun 2013 21:52:24 -0400
Subject: [PATCH] Simplifies the check for determining whether whitelisted
users are present. Adds an a doc comment for the whitelisted users arg.
---
chkcrontab_lib.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/chkcrontab_lib.py b/chkcrontab_lib.py
index b212519..c1c1004 100755
--- a/chkcrontab_lib.py
+++ b/chkcrontab_lib.py
@@ -1052,6 +1052,7 @@ def check_crontab(crontab_file, log, whitelisted_users=None):
Args:
crontab_file: Name of the crontab file to check.
log: A LogCounter object.
+ whitelisted_users: A comma delimited list of users to ignore when warning on unrecognized users.
Returns:
0 if there were no errors.
@@ -1064,7 +1065,7 @@ def check_crontab(crontab_file, log, whitelisted_users=None):
return log.Summary()
# Add the any specified users to the whitelist
- if not whitelisted_users is None:
+ if whitelisted_users:
USER_WHITELIST.update(whitelisted_users)
# Check the file name.
--
GitLab