summaryrefslogtreecommitdiffstats
path: root/lib/puppet/file_bucket
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-03-30 16:33:44 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commit8f9fc30bb3b992322a553aa7dc0c504af5e44250 (patch)
tree858c75522bc018ff65ae5ca5e0e76158ffc433dc /lib/puppet/file_bucket
parent23ccefe0e8b51af19a0283c0d8eb3de09b6e4c31 (diff)
downloadpuppet-8f9fc30bb3b992322a553aa7dc0c504af5e44250.tar.gz
puppet-8f9fc30bb3b992322a553aa7dc0c504af5e44250.tar.xz
puppet-8f9fc30bb3b992322a553aa7dc0c504af5e44250.zip
REST FileBucket: REST barfs on relative paths
Force FileBucket to always send absolute (real) paths
Diffstat (limited to 'lib/puppet/file_bucket')
-rw-r--r--lib/puppet/file_bucket/dipper.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/puppet/file_bucket/dipper.rb b/lib/puppet/file_bucket/dipper.rb
index b13e590a9..b4a9eb83d 100644
--- a/lib/puppet/file_bucket/dipper.rb
+++ b/lib/puppet/file_bucket/dipper.rb
@@ -35,7 +35,7 @@ class Puppet::FileBucket::Dipper
end
contents = ::File.read(file)
begin
- file_bucket_file = Puppet::FileBucket::File.new(contents, :bucket_path => @local_path, :path => file)
+ file_bucket_file = Puppet::FileBucket::File.new(contents, :bucket_path => @local_path, :path => absolutize_path(file) )
dest_path = "#{@rest_path}#{file_bucket_file.name}"
file_bucket_file.save(dest_path)
@@ -91,5 +91,12 @@ class Puppet::FileBucket::Dipper
return nil
end
end
+
+ private
+ def absolutize_path( path )
+ require 'pathname'
+ Pathname.new(path).realpath
+ end
+
end