summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-01-02 14:32:54 -0600
committerLuke Kanies <luke@madstop.com>2008-01-02 14:32:54 -0600
commitb7b11bd4858a4d6dd0661aa7c546d03b4a85ca7d (patch)
tree7fa0a67b87d9ce19a51a468c0fe79c33e9ccbcdb /lib/puppet
parentb1f13af734cc75d1b8c73f06d0619b99c65978c0 (diff)
Fixing a couple of failing tests
Diffstat (limited to 'lib/puppet')
-rwxr-xr-xlib/puppet/type/schedule.rb4
-rw-r--r--lib/puppet/util/nagios_maker.rb5
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