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
a5607365
Commit
a5607365
authored
Jul 16, 2015
by
amd
Browse files
Make sure each file has a trailing newline.
parent
d4cbe2ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
chkcrontab_lib.py
View file @
a5607365
...
...
@@ -1083,6 +1083,8 @@ def check_crontab(crontab_file, log, whitelisted_users=None):
cron_line_factory
=
CronLineFactory
()
with
open
(
crontab_file
,
'r'
)
as
crontab_f
:
for
line
in
crontab_f
:
missing_newline
=
line
[
-
1
]
!=
"
\n
"
line
=
line
.
strip
()
line_no
+=
1
...
...
@@ -1091,5 +1093,9 @@ def check_crontab(crontab_file, log, whitelisted_users=None):
log
.
Emit
(
line_no
,
line
)
# are we missing a trailing newline?
if
missing_newline
:
log
.
Error
(
'Cron will not process this file - missing trailing newline'
)
# Summarize the log messages if there were any.
return
log
.
Summary
()
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