summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-11-14 19:27:50 -0600
committerLuke Kanies <luke@madstop.com>2008-11-15 02:25:47 -0600
commit053d7bfa678b152c42bf3fcbccaaa86aa578c39b (patch)
tree69904d2ac68767bf680b397d08ed066993e3d67d /lib/puppet
parenta8d9976d0a11c4dc50b2ef49c63f3f745cb4eccb (diff)
downloadpuppet-053d7bfa678b152c42bf3fcbccaaa86aa578c39b.tar.gz
puppet-053d7bfa678b152c42bf3fcbccaaa86aa578c39b.tar.xz
puppet-053d7bfa678b152c42bf3fcbccaaa86aa578c39b.zip
These changes are all about making sure file data is expired when appropriate.
All file tests now pass. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/node/catalog.rb4
-rwxr-xr-xlib/puppet/type/file/content.rb1
-rwxr-xr-xlib/puppet/type/file/source.rb4
3 files changed, 7 insertions, 2 deletions
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