diff options
author | Jesse Wolfe <jes5199@gmail.com> | 2010-01-05 19:08:23 -0800 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2010-01-12 10:30:52 +1100 |
commit | c99f394bf8c10d13f3fa7d3ab7ab43ecf454c081 (patch) | |
tree | 41168c8d96162d52a545840690c4decc08eaa6be /lib/puppet/provider | |
parent | 0a7e212cb824a3a13bc00abf2e69aa3852c6c4d9 (diff) | |
download | puppet-c99f394bf8c10d13f3fa7d3ab7ab43ecf454c081.tar.gz puppet-c99f394bf8c10d13f3fa7d3ab7ab43ecf454c081.tar.xz puppet-c99f394bf8c10d13f3fa7d3ab7ab43ecf454c081.zip |
Fix #2845 Cron entries using "special" parameter lose their title when changed
Merged the "freebsd_special" pattern into the other crontab records,
since its definition was incomplete
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
Diffstat (limited to 'lib/puppet/provider')
-rwxr-xr-x | lib/puppet/provider/cron/crontab.rb | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/puppet/provider/cron/crontab.rb b/lib/puppet/provider/cron/crontab.rb index 6dee2e515..28ef05974 100755 --- a/lib/puppet/provider/cron/crontab.rb +++ b/lib/puppet/provider/cron/crontab.rb @@ -27,18 +27,13 @@ Puppet::Type.type(:cron).provide(:crontab, text_line :environment, :match => %r{^\w+=} - record_line :freebsd_special, :fields => %w{special command}, - :match => %r{^@(\w+)\s+(.+)$}, :pre_gen => proc { |record| - record[:special] = "@" + record[:special] - } - - crontab = record_line :crontab, :fields => %w{minute hour monthday month weekday command}, - :match => %r{^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(.+)$}, - :optional => %w{minute hour weekday month monthday}, :absent => "*" + crontab = record_line :crontab, :fields => %w{special minute hour monthday month weekday command}, + :match => %r{^\s*(?:@(\w+)|(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+))\s+(.+)$}, + :optional => %w{special minute hour weekday month monthday}, :absent => "*" class << crontab def numeric_fields - fields - [:command] + fields - [:command, :special] end # Do some post-processing of the parsed record. Basically just # split the numeric fields on ','. |