summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-19 01:42:10 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-19 01:42:10 +0000
commit5f7ae353a0ca9cadaf8fdc8803e1227ee6583d25 (patch)
tree840d708a742ab0234be7f55f3cf478a526a5f6a3 /lib
parenta2a9d93fd3f9de6d4c6d13ca8d99c2d496a39e40 (diff)
downloadpuppet-5f7ae353a0ca9cadaf8fdc8803e1227ee6583d25.tar.gz
puppet-5f7ae353a0ca9cadaf8fdc8803e1227ee6583d25.tar.xz
puppet-5f7ae353a0ca9cadaf8fdc8803e1227ee6583d25.zip
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
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/network/client/master.rb13
1 files changed, 13 insertions, 0 deletions
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