diff options
author | James Turnbull <james@lovedthanlost.net> | 2009-07-05 18:50:24 +1000 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-07-05 18:50:24 +1000 |
commit | aaca17a26092f3fece9a835eddf3ad6b9cf82300 (patch) | |
tree | 106ceef77fb3a83fd0fb60c1eda3648996e3d7f1 | |
parent | cddc365e9bac786c7a64240073b69bc54b6d2f2e (diff) | |
download | puppet-aaca17a26092f3fece9a835eddf3ad6b9cf82300.tar.gz puppet-aaca17a26092f3fece9a835eddf3ad6b9cf82300.tar.xz puppet-aaca17a26092f3fece9a835eddf3ad6b9cf82300.zip |
Fixed #2293 - Added cron syntax X-Y/Z and '7' for sunday
-rwxr-xr-x | lib/puppet/type/cron.rb | 11 |
1 files 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 |