From aaca17a26092f3fece9a835eddf3ad6b9cf82300 Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Sun, 5 Jul 2009 18:50:24 +1000 Subject: Fixed #2293 - Added cron syntax X-Y/Z and '7' for sunday --- lib/puppet/type/cron.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/puppet/type/cron.rb b/lib/puppet/type/cron.rb index dcc363254..1269f3872 100755 --- a/lib/puppet/type/cron.rb +++ b/lib/puppet/type/cron.rb @@ -173,6 +173,11 @@ Puppet::Type.newtype(:cron) do return value end + # Allow ranges + */2 + if value =~ /^[0-9]+-[0-9]+\/[0-9]+$/ + return value + end + if value == "*" return value end @@ -268,10 +273,10 @@ Puppet::Type.newtype(:cron) do def alpha %w{sunday monday tuesday wednesday thursday friday saturday} end - self.boundaries = [0, 6] + self.boundaries = [0, 7] desc "The weekday on which to run the command. - Optional; if specified, must be between 0 and 6, inclusive, with - 0 being Sunday, or must be the name of the day (e.g., Tuesday)." + Optional; if specified, must be between 0 and 7, inclusive, with + 0 (or 7) being Sunday, or must be the name of the day (e.g., Tuesday)." end newproperty(:month, :parent => CronParam) do -- cgit