From 053d7bfa678b152c42bf3fcbccaaa86aa578c39b Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Fri, 14 Nov 2008 19:27:50 -0600 Subject: These changes are all about making sure file data is expired when appropriate. All file tests now pass. Signed-off-by: Luke Kanies --- lib/puppet/node/catalog.rb | 4 ++++ lib/puppet/type/file/content.rb | 1 + lib/puppet/type/file/source.rb | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/puppet/node/catalog.rb b/lib/puppet/node/catalog.rb index e82e63444..f6c0a1959 100644 --- a/lib/puppet/node/catalog.rb +++ b/lib/puppet/node/catalog.rb @@ -118,6 +118,10 @@ class Puppet::Node::Catalog < Puppet::SimpleGraph def apply(options = {}) @applying = true + # Expire all of the resource data -- this ensures that all + # data we're operating against is entirely current. + expire() + Puppet::Util::Storage.load if host_config? transaction = Puppet::Transaction.new(self) diff --git a/lib/puppet/type/file/content.rb b/lib/puppet/type/file/content.rb index 169ba9078..635cdc809 100755 --- a/lib/puppet/type/file/content.rb +++ b/lib/puppet/type/file/content.rb @@ -58,6 +58,7 @@ module Puppet if self.should return super elsif source = resource.parameter(:source) + fail "Got a remote source with no checksum" unless source.checksum unless sum_method = sumtype(source.checksum) fail "Could not extract checksum type from source checksum '%s'" % source.checksum end diff --git a/lib/puppet/type/file/source.rb b/lib/puppet/type/file/source.rb index 4e67b1a8b..a6ab5daaf 100755 --- a/lib/puppet/type/file/source.rb +++ b/lib/puppet/type/file/source.rb @@ -93,8 +93,8 @@ module Puppet end def checksum - if defined?(@metadata) - @metadata.checksum + if metadata + metadata.checksum else nil end -- cgit