Merge lp://qastaging/~pyepye/python-crontab/fix-system-cron-parsing into lp://qastaging/~doctormo/python-crontab/trunk

Proposed by Alan Wong
Status: Merged
Merged at revision: 113
Proposed branch: lp://qastaging/~pyepye/python-crontab/fix-system-cron-parsing
Merge into: lp://qastaging/~doctormo/python-crontab/trunk
Diff against target: 36 lines (+12/-3)
2 files modified
crontab.py (+5/-3)
tests/test_system_cron.py (+7/-0)
To merge this branch: bzr merge lp://qastaging/~pyepye/python-crontab/fix-system-cron-parsing
Reviewer Review Type Date Requested Status
Martin Owens code Approve
Review via email: mp+253793@code.qastaging.launchpad.net

Description of the change

The system cron parsing code path expects that the sixth component of a crontab line is composed of <user cmd>. In the off chance that a comment has six components, the forceful assignment to the (user, cmd) tuple throws an exception. This fix checks the array length prior to assignment.

To post a comment you must log in.
Revision history for this message
Martin Owens (doctormo) wrote :

The code looks good and the test suite is great. I shortened the number of lines, hopefully this won't be any problem (I've tested various things)

Thanks for the contribution! you rock.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: