summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2011-05-07 20:25:07 +0200
committerintrigeri <intrigeri@boum.org>2011-05-07 20:25:07 +0200
commit53c7ff231ae95dc985ac74a89b11430c9296eb8f (patch)
tree3fc50e7f6381e7c1d7f68334fa9a895d389c677a /files
parentf37df509cf1ea3edafd4e60eaa349add9ae19e63 (diff)
parent05a9d526ab7a23dea30058dbb3ac21a9bb521dab (diff)
Merge remote branch 'immerda/master'
Diffstat (limited to 'files')
-rw-r--r--files/master/lastruncheck14
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|