[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, squeeze, updated. debian/2.6.0-4-3-gbb8efea

Stig Sandbeck Mathisen ssm at debian.org
Tue Sep 14 08:57:29 UTC 2010


The following commit has been merged in the squeeze branch:
commit 870b9e6a3f9c9cc6e3719a40cb8d19f107709e15
Author: Markus Roberts <Markus at reality.com>
Date:   Sat Aug 21 19:44:06 2010 -0700

    Fix for #4489 -- apply was using the rest terminus
    
    Basing pervasive low-level behaviour changes on the application name isn't a
    good idea, but if we're going to do it we need to remember to update the test
    when we rename the application.  Further, if we optimize around such low-level
    tests (as we did when implementing file-streaming) we need to carry the tests
    over into the new data paths.
    
    This commit addresses both of these isues, restoring 0.25.x stand-alone file
    serving by adjusting the process-name test in the indirector to recognize
    "apply" as standalone (and thus not use http to fetch the files) and by adding
    a branch to the file streaming code to do the same when fetching the content.
    
    I am not certain that this change is globally correct; there may be other
    related problems that will not be fixed (and may in fact be exacerbated) by
    this patch.

diff --git a/lib/puppet/type/file/content.rb b/lib/puppet/type/file/content.rb
index 74b380f..7acd476 100755
--- a/lib/puppet/type/file/content.rb
+++ b/lib/puppet/type/file/content.rb
@@ -166,6 +166,8 @@ module Puppet
         yield source_or_content
       elsif source_or_content.nil?
         yield read_file_from_filebucket
+      elsif Puppet.settings[:name] == "apply"
+        yield source_or_content.content
       elsif source_or_content.local?
         chunk_file_from_disk(source_or_content) { |chunk| yield chunk }
       else
diff --git a/lib/puppet/type/file/source.rb b/lib/puppet/type/file/source.rb
index 2eaf4a3..88d5148 100755
--- a/lib/puppet/type/file/source.rb
+++ b/lib/puppet/type/file/source.rb
@@ -94,6 +94,16 @@ module Puppet
       metadata && metadata.checksum
     end
 
+    # Look up (if necessary) and return remote content.
+    cached_attr(:content) do
+      raise Puppet::DevError, "No source for content was stored with the metadata" unless metadata.source
+
+      unless tmp = Puppet::FileServing::Content.find(metadata.source)
+        fail "Could not find any content at %s" % metadata.source
+      end
+      tmp.content
+    end
+
     # Copy the values from the source to the resource.  Yay.
     def copy_source_values
       devfail "Somehow got asked to copy source values without any metadata" unless metadata

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list