diff options
| author | Luke Kanies <luke@madstop.com> | 2008-01-02 14:32:54 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-01-02 14:32:54 -0600 |
| commit | b7b11bd4858a4d6dd0661aa7c546d03b4a85ca7d (patch) | |
| tree | 7fa0a67b87d9ce19a51a468c0fe79c33e9ccbcdb /lib | |
| parent | b1f13af734cc75d1b8c73f06d0619b99c65978c0 (diff) | |
Fixing a couple of failing tests
Diffstat (limited to 'lib')
| -rwxr-xr-x | lib/puppet/type/schedule.rb | 4 | ||||
| -rw-r--r-- | lib/puppet/util/nagios_maker.rb | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/puppet/type/schedule.rb b/lib/puppet/type/schedule.rb index b8479e01d..c494c5d94 100755 --- a/lib/puppet/type/schedule.rb +++ b/lib/puppet/type/schedule.rb @@ -241,7 +241,9 @@ module Puppet :daily => :day, :monthly => :month, :weekly => proc do |prev, now| - prev.strftime("%U") != now.strftime("%U") + # Run the resource if the previous day was after this weekday (e.g., prev is wed, current is tue) + # or if it's been more than a week since we ran + prev.wday > now.wday or (now - prev) > (24 * 3600 * 7) end } diff --git a/lib/puppet/util/nagios_maker.rb b/lib/puppet/util/nagios_maker.rb index 88402838f..a7aae4e70 100644 --- a/lib/puppet/util/nagios_maker.rb +++ b/lib/puppet/util/nagios_maker.rb @@ -40,14 +40,15 @@ module Puppet::Util::NagiosMaker end end - provider = type.provide(:naginator, :parent => Puppet::Provider::Naginator, :default_target => "/etc/nagios/#{full_name.to_s}.cfg") {} + target = "/etc/nagios/#{full_name.to_s}.cfg" + provider = type.provide(:naginator, :parent => Puppet::Provider::Naginator, :default_target => target) {} type.desc "The Nagios type #{name.to_s}. This resource type is autogenerated using the model developed in Naginator_, and all of the Nagios types are generated using the same code and the same library. This type generates Nagios configuration statements in Nagios-parseable configuration - files. By default, the statements will be added to ``#{provider.default_target}``, but + files. By default, the statements will be added to ``#{target}``, but you can send them to a different file by setting their ``target`` attribute. .. _naginator: http://reductivelabs.com/trac/naginator |
