[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35
Jesse Wolfe
jes5199 at gmail.com
Wed Jul 14 10:32:21 UTC 2010
The following commit has been merged in the upstream branch:
commit e31fe8ce42ac6582507761c10472ec0d8f5dd7dc
Author: Jesse Wolfe <jes5199 at gmail.com>
Date: Fri Apr 9 19:18:56 2010 -0700
Fix a failure in new FileBucket where it was impossible to read from a
bucket with a non-default path.
Signed-off-by: Jesse Wolfe <jes5199 at gmail.com>
diff --git a/lib/puppet/file_bucket/dipper.rb b/lib/puppet/file_bucket/dipper.rb
index b4a9eb8..d9239e8 100644
--- a/lib/puppet/file_bucket/dipper.rb
+++ b/lib/puppet/file_bucket/dipper.rb
@@ -49,8 +49,9 @@ class Puppet::FileBucket::Dipper
# Retrieve a file by sum.
def getfile(sum)
source_path = "#{@rest_path}md5/#{sum}"
- file_bucket_file = Puppet::FileBucket::File.find(source_path)
+ file_bucket_file = Puppet::FileBucket::File.find(source_path, :bucket_path => @local_path)
+ raise Puppet::Error, "File not found" unless file_bucket_file
return file_bucket_file.to_s
end
diff --git a/lib/puppet/file_bucket/file.rb b/lib/puppet/file_bucket/file.rb
index 7122bfb..1e95e5e 100644
--- a/lib/puppet/file_bucket/file.rb
+++ b/lib/puppet/file_bucket/file.rb
@@ -13,7 +13,7 @@ class Puppet::FileBucket::File
attr :paths, true
attr :contents, true
attr :checksum_type
- attr :bucket_path
+ attr :bucket_path, true
def self.default_checksum_type
:md5
diff --git a/lib/puppet/indirector/file_bucket_file/file.rb b/lib/puppet/indirector/file_bucket_file/file.rb
index d32533d..4c08b8d 100644
--- a/lib/puppet/indirector/file_bucket_file/file.rb
+++ b/lib/puppet/indirector/file_bucket_file/file.rb
@@ -11,7 +11,7 @@ module Puppet::FileBucketFile
def find( request )
checksum, path = request_to_checksum_and_path( request )
- return find_by_checksum( checksum )
+ return find_by_checksum( checksum, request.options )
end
def save( request )
@@ -27,8 +27,9 @@ module Puppet::FileBucketFile
private
- def find_by_checksum( checksum )
+ def find_by_checksum( checksum, options )
model.new( nil, :checksum => checksum ) do |bucket_file|
+ bucket_file.bucket_path = options[:bucket_path]
filename = contents_path_for( bucket_file )
if ! ::File.exist? filename
diff --git a/test/network/client/dipper.rb b/test/network/client/dipper.rb
index 611ee73..17298c4 100755
--- a/test/network/client/dipper.rb
+++ b/test/network/client/dipper.rb
@@ -3,7 +3,7 @@
require File.dirname(__FILE__) + '/../../lib/puppettest'
require 'puppettest'
-require 'puppet/network/client/resource'
+require 'puppet/file_bucket/dipper'
class TestDipperClient < Test::Unit::TestCase
include PuppetTest::ServerTest
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list