diff --git a/lib/puppet/type/schedule.rb b/lib/puppet/type/schedule.rb index e664a6e0c..c68422849 100755 --- a/lib/puppet/type/schedule.rb +++ b/lib/puppet/type/schedule.rb @@ -228,7 +228,7 @@ module Puppet See the ``periodmatch`` attribute for tuning whether to match times by their distance apart or by their specific value." - newvalues(:hourly, :daily, :weekly, :monthly) + newvalues(:hourly, :daily, :weekly, :monthly, :never) @@scale = { :hourly => 3600, @@ -246,6 +246,8 @@ module Puppet } def match?(previous, now) + return false if value == :never + value = self.value case @parent[:periodmatch] when :number diff --git a/test/ral/types/schedule.rb b/test/ral/types/schedule.rb index e50f88bab..e9b3ef8b3 100755 --- a/test/ral/types/schedule.rb +++ b/test/ral/types/schedule.rb @@ -340,6 +340,18 @@ class TestSchedule < Test::Unit::TestCase assert(! s.match?(min("-", 15)), "matched minus 15 minutes with half-hourly") assert(s.match?(min("-", 25)), "Did not match minus 25 with half-hourly") end + + # #526 + def test_never_period + schedule = nil + assert_nothing_raised do + schedule = Puppet::Type.type(:schedule).create( + :name => "test", :period => :never + ) + end + + assert(! schedule.match?, "schedule matched with period == never") + end end # $Id$