[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:30 UTC 2010


The following commit has been merged in the squeeze branch:
commit a3d4166b25e0adcf691a0b090c47192ba008bb42
Author: Brice Figureau <brice-puppet at daysofwonder.com>
Date:   Wed Jul 21 22:56:58 2010 +0200

    Fix #4319 - source file url sent to the master is invalid
    
    We were sending an incorrect (containing a //) url for sourced file
    content since the file streaming patches.
    Depending on the webserver in front of puppet it could fail (for instance
    nginx+mongrel).
    
    This patch fixes the offending // in each sourced file urls.
    
    Signed-off-by: Brice Figureau <brice-puppet at daysofwonder.com>

diff --git a/lib/puppet/type/file/content.rb b/lib/puppet/type/file/content.rb
index 7acd476..f5b65d3 100755
--- a/lib/puppet/type/file/content.rb
+++ b/lib/puppet/type/file/content.rb
@@ -186,7 +186,7 @@ module Puppet
     end
 
     def chunk_file_from_source(source_or_content)
-      request = Puppet::Indirector::Request.new(:file_content, :find, source_or_content.full_path)
+      request = Puppet::Indirector::Request.new(:file_content, :find, source_or_content.full_path.sub(/^\//,''))
       connection = Puppet::Network::HttpPool.http_instance(source_or_content.server, source_or_content.port)
       connection.request_get(indirection2uri(request), add_accept_encoding({"Accept" => "raw"})) do |response|
         case response.code
diff --git a/spec/unit/type/file/content_spec.rb b/spec/unit/type/file/content_spec.rb
index e4b9f9b..a01a14a 100755
--- a/spec/unit/type/file/content_spec.rb
+++ b/spec/unit/type/file/content_spec.rb
@@ -362,7 +362,7 @@ describe content do
       end
 
       it "should send the correct indirection uri" do
-        @conn.expects(:request_get).with { |uri,headers| uri == "/production/file_content//path/to/source" }.yields(@response)
+        @conn.expects(:request_get).with { |uri,headers| uri == "/production/file_content/path/to/source" }.yields(@response)
         @content.write(@fh)
       end
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list