Bug#766348: Does not parse ranges correctly
Yuri D'Elia
wavexx at thregr.org
Wed Oct 22 14:07:13 BST 2014
Package: systemd-cron
Version: 1.3.1+ds1-1
Severity: important
Ranges without steps (1-12) are not correctly parsed by systemd-crontab-generator.
For example, the line:
55-59 11 * * 1-6 true
results in the following:
$ ./systemd-crontab-generator /tmp/test
Traceback (most recent call last):
File "./systemd-crontab-generator", line 273, in <module>
for job in parse_crontab(filename, withuser=False):
File "./systemd-crontab-generator", line 125, in parse_crontab
'm': parse_time_unit(minutes, MINUTES_SET),
File "./systemd-crontab-generator", line 138, in parse_time_unit
map(parse_period(mapping), value.split(','))), set())))
File "./systemd-crontab-generator", line 157, in parser
value = mapping(value)
ValueError: invalid literal for int() with base 10: '55-59'
The attached patch fixes the issue.
-- System Information:
Debian Release: jessie/sid
APT prefers unstable
APT policy: (900, 'unstable'), (800, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.16-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages systemd-cron depends on:
ii init-system-helpers 1.21
ii python 2.7.8-1
pn python:any <none>
ii systemd-sysv 215-5+b1
systemd-cron recommends no packages.
systemd-cron suggests no packages.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: allow-ranges.diff
Type: text/x-diff
Size: 449 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-systemd-maintainers/attachments/20141022/26249615/attachment.diff>
More information about the Pkg-systemd-maintainers
mailing list