Skip to content
Snippets Groups Projects
Commit 75dba515 authored by Kevin Lyda's avatar Kevin Lyda
Browse files

Fix print issues in cli, add future imports.

parent 4ab7e48b
Branches
Tags
No related merge requests found
...@@ -51,7 +51,8 @@ TODO ...@@ -51,7 +51,8 @@ TODO
* Look for duplicate entries. Puppet sometimes loads up crontabs * Look for duplicate entries. Puppet sometimes loads up crontabs
with dups. with dups.
* Check for backticks. (why?) * Check for backticks. (why?)
* Make sure MAILTO and PATH are set (perhaps others?) * Make sure MAILTO and PATH are set (perhaps others?).
* Add tests for command line.
Credits Credits
======= =======
......
...@@ -22,6 +22,8 @@ Basic usage: ...@@ -22,6 +22,8 @@ Basic usage:
chkcrontab crontab_file chkcrontab crontab_file
""" """
from __future__ import print_function
__author__ = 'lyda@google.com (Kevin Lyda)' __author__ = 'lyda@google.com (Kevin Lyda)'
import sys import sys
...@@ -31,10 +33,10 @@ import chkcrontab_lib as check ...@@ -31,10 +33,10 @@ import chkcrontab_lib as check
def main(argv): def main(argv):
"""main program.""" """main program."""
if len(argv) != 2: if len(argv) != 2:
print 'ERROR: No crontab file was specified.' print('ERROR: No crontab file was specified.')
sys.exit(1) sys.exit(1)
log = check.LogCounter() log = check.LogCounter()
print 'Checking correctness of %s' % argv[1] print('Checking correctness of %s' % argv[1])
return check.check_crontab(argv[1], log) return check.check_crontab(argv[1], log)
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -65,6 +65,7 @@ A brief description of each class and function: ...@@ -65,6 +65,7 @@ A brief description of each class and function:
CheckCrontab: Checks the a crontab file. CheckCrontab: Checks the a crontab file.
""" """
from __future__ import print_function
# For Python 2.5 # For Python 2.5
from __future__ import with_statement from __future__ import with_statement
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment