Please review pull request #725: Allow 1/2 syntax in cron files,... opened by (hcgrove)

Description:

to allow people to run cron jobs regularly with an offset.

I have a service that I want to run 4 times an hour, but on different times on different hosts (as the service contacts a server that would die if every server connected at the same time. The nice way to do that is a cron job that runs at /15.

  • Opened: Fri Apr 27 13:56:06 UTC 2012
  • Based on: puppetlabs:master (b5847f4b2d6af7afc839a4f8e15c37675ab378a0)
  • Requested merge: hcgrove:patch-1 (a2eb6e3c7fddd9d293741ab93f6e8537292b73f3)

Diff follows:

diff --git a/lib/puppet/type/cron.rb b/lib/puppet/type/cron.rb
index a742a17..6d79ad7 100755
--- a/lib/puppet/type/cron.rb
+++ b/lib/puppet/type/cron.rb
@@ -164,7 +164,12 @@ def should=(ary)
       if value =~ /^[0-9]+-[0-9]+\/[0-9]+$/
         return value
       end
-
+      
+      # Allow the 1/2 syntax
+      if value =~ /^[0-9]+\/[0-9]+$/
+        return value
+      end
+      
       if value == "*"
         return :absent
       end

    

--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to