diff options
author | Micah Anderson <micah@riseup.net> | 2012-06-27 22:41:03 -0400 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2012-06-27 22:41:03 -0400 |
commit | f54e980211a88b6e470cb34e78e418e7a7b3de2a (patch) | |
tree | 8f06b32276b73ad8973feeab7ca7f33b464e65c1 /files/master | |
parent | 06942f75f03b5c8a78c8b3a9f466bf72b1b34f5c (diff) | |
parent | dffec4d8134be8a2eb2bb3a8063b2d60d67308f1 (diff) |
Merge remote-tracking branch 'shared/master'
Diffstat (limited to 'files/master')
-rw-r--r-- | files/master/lastruncheck | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/files/master/lastruncheck b/files/master/lastruncheck index 420730f..d59e489 100644 --- a/files/master/lastruncheck +++ b/files/master/lastruncheck @@ -23,9 +23,11 @@ module Puppet::Lastcheck def facts_hosts return @facts_hosts if @facts_hosts require 'puppet/indirector/facts/yaml' - @facts_hosts = Puppet::Node::Facts.search("*").collect do |node| - { :hostname => node.name, :expired => node.expired?, :timestamp => node.values[:_timestamp], :expiration => node.expiration } - end + @facts_hosts = Puppet::Node::Facts.indirection.search("*").collect do |fqdn| + if node = Puppet::Node::Facts.indirection.find(fqdn) + { :hostname => node.name, :expired => node.expired?, :timestamp => node.values[:_timestamp], :expiration => node.expiration } + end + end.compact end end end @@ -96,7 +98,9 @@ module Puppet::Lastcheck::Tests::Storedconfigs storedconfigs_hosts.each do |host| if !facts_hosts.any?{|fact_host| fact_host[:hostname] == host.name } add_failed_host(host.name, "In storedconfigs but no facts available!") - elsif host.last_compile.nil? || host.last_compile < (Time.now - @timeout) + elsif host.last_compile.nil? + add_failed_host(host.name, "No entry in storedconfigs") + elsif host.last_compile < (Time.now - @timeout) add_failed_host(host.name, "Last compile time in storedconfigs at #{host.last_compile}") end end @@ -185,8 +189,8 @@ class Puppet::Application::Lastcheck < Puppet::Application def setup exit(Puppet.settings.print_configs ? 0 : 1) if Puppet.settings.print_configs? - Puppet::Util::Log.newdestination :console - Puppet::Node::Facts.terminus_class = :yaml + #Puppet::Util::Log.newdestination :console + Puppet::Node::Facts.indirection.terminus_class = :yaml Puppet::Lastcheck::Tests.tests.keys.each do |test| self.send("ignore_#{test}=", Puppet::Lastcheck::Tests.tests[test][:ignore_by_default]||false) unless self.send("ignore_#{test}") |