summaryrefslogtreecommitdiffstats
path: root/lib/puppet/provider
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-01-05 19:08:23 -0800
committerJames Turnbull <james@lovedthanlost.net>2010-01-12 10:30:52 +1100
commitc99f394bf8c10d13f3fa7d3ab7ab43ecf454c081 (patch)
tree41168c8d96162d52a545840690c4decc08eaa6be /lib/puppet/provider
parent0a7e212cb824a3a13bc00abf2e69aa3852c6c4d9 (diff)
downloadpuppet-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-xlib/puppet/provider/cron/crontab.rb13
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 ','.