Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kevin Lyda
chkcrontab
Commits
28e8d13b
Commit
28e8d13b
authored
Jun 11, 2013
by
Jeremy Jarrell
Browse files
Extracts the logic to determine if whitelisted users are specified into a separate method.
parent
a90c3192
Changes
1
Hide whitespace changes
Inline
Side-by-side
chkcrontab
View file @
28e8d13b
...
...
@@ -36,15 +36,16 @@ def main(argv):
print
(
'ERROR: No crontab file was specified.'
)
sys
.
exit
(
1
)
whitelisted_users
=
None
log
=
check
.
LogCounter
()
print
(
'Checking correctness of %s'
%
argv
[
1
])
return
check
.
check_crontab
(
argv
[
1
],
log
,
get_whitelisted_users
(
argv
))
def
get_whitelisted_users
(
argv
):
if
len
(
argv
)
>
2
:
for
arg
in
argv
:
if
'--whitelist'
in
arg
:
whitelisted_users
=
arg
[
'--whitelist='
.
__len__
():].
split
(
','
)
log
=
check
.
LogCounter
()
print
(
'Checking correctness of %s'
%
argv
[
1
])
return
check
.
check_crontab
(
argv
[
1
],
log
,
whitelisted_users
)
return
arg
[
'--whitelist='
.
__len__
():].
split
(
','
)
return
None
if
__name__
==
'__main__'
:
sys
.
exit
(
main
(
sys
.
argv
))
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment