From 5f7ae353a0ca9cadaf8fdc8803e1227ee6583d25 Mon Sep 17 00:00:00 2001 From: luke Date: Mon, 19 Mar 2007 01:42:10 +0000 Subject: Fixing #519. The facts are now cached in the state file and changes to them force a recompile. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2303 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/network/client/master.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib') diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb index 7553a62c7..506ed09e8 100644 --- a/lib/puppet/network/client/master.rb +++ b/lib/puppet/network/client/master.rb @@ -127,10 +127,22 @@ class Puppet::Network::Client::Master < Puppet::Network::Client end end + # Have the facts changed since we last compiled? + def facts_changed? + oldfacts = Puppet::Util::Storage.cache(:configuration)[:facts] + newfacts = self.class.facts + if oldfacts == newfacts + return false + else + return true + end + end + # Check whether our configuration is up to date def fresh? return false if Puppet[:ignorecache] return false unless self.compile_time + return false if self.facts_changed? # We're willing to give a 2 second drift if @driver.freshness - @compile_time.to_i < 1 @@ -570,6 +582,7 @@ class Puppet::Network::Client::Master < Puppet::Network::Client fromcache = true else @compile_time = Time.now + Puppet::Util::Storage.cache(:configuration)[:facts] = facts Puppet::Util::Storage.cache(:configuration)[:compile_time] = @compile_time end -- cgit