diff options
author | Micah Anderson <micah@riseup.net> | 2012-02-15 12:05:58 -0500 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2012-02-15 12:05:58 -0500 |
commit | 1b1a1cd8b16ad75df959c1764c4d186407f26484 (patch) | |
tree | d3cb4004efc3af780b6459eb1f19d3e98b958734 /files/master/lastruncheck | |
parent | 3bcfd81f64f504cb9be05ccdb8b81652ff872d0f (diff) | |
parent | 05a9d526ab7a23dea30058dbb3ac21a9bb521dab (diff) |
Merge commit '05a9d526ab7a23dea30058dbb3ac21a9bb521dab'
Diffstat (limited to 'files/master/lastruncheck')
-rw-r--r-- | files/master/lastruncheck | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/files/master/lastruncheck b/files/master/lastruncheck index 420730f..149c655 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.search("*").collect do |fqdn| + if node = Puppet::Node::Facts.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,7 +189,7 @@ 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::Util::Log.newdestination :console Puppet::Node::Facts.terminus_class = :yaml Puppet::Lastcheck::Tests.tests.keys.each do |test| |