diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-04-27 16:59:10 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-04-27 16:59:10 +0000 |
| commit | 9b627cd0e061316feb73f332abb3c1e4e7aefe28 (patch) | |
| tree | 72797181153ce9469fa06f382b3397b016be34c2 /lib/puppet/server | |
| parent | 003e897f6839b7f5e771c2b8f4c7feb9fadba4dc (diff) | |
| download | puppet-9b627cd0e061316feb73f332abb3c1e4e7aefe28.tar.gz puppet-9b627cd0e061316feb73f332abb3c1e4e7aefe28.tar.xz puppet-9b627cd0e061316feb73f332abb3c1e4e7aefe28.zip | |
Trying to track down the bugs reported this morning, so I added some more test cases. I did find a bug in the filebuckets, fixed it, and added a test case.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1143 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/server')
| -rwxr-xr-x | lib/puppet/server/filebucket.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/puppet/server/filebucket.rb b/lib/puppet/server/filebucket.rb index 8a4d1a0a4..d07fc93af 100755 --- a/lib/puppet/server/filebucket.rb +++ b/lib/puppet/server/filebucket.rb @@ -16,7 +16,7 @@ class Server Puppet.config.setdefaults("filebucket", :bucketdir => { :default => "$vardir/bucket", - :mode => 0770, + :mode => 0750, :owner => "$user", :group => "$group", :desc => "Where FileBucket files are stored." @@ -28,7 +28,7 @@ class Server } Puppet::Util.logmethods(self, true) - attr_reader :name + attr_reader :name, :path # this doesn't work for relative paths def FileBucket.paths(base,md5) @@ -48,19 +48,19 @@ class Server end if hash.include?(:Path) - @bucket = hash[:Path] + @path = hash[:Path] hash.delete(:Path) else if defined? Puppet - @bucket = Puppet[:bucketdir] + @path = Puppet[:bucketdir] else - @bucket = File.expand_path("~/.filebucket") + @path = File.expand_path("~/.filebucket") end end Puppet.config.use(:filebucket) - @name = "filebucket[#{Puppet[:bucketdir]}]" + @name = "filebucket[#{@path}]" end # accept a file from a client @@ -68,7 +68,7 @@ class Server contents = Base64.decode64(string) md5 = Digest::MD5.hexdigest(contents) - bpath, bfile, pathpath = FileBucket.paths(@bucket,md5) + bpath, bfile, pathpath = FileBucket.paths(@path,md5) # if it's a new directory... if Puppet.recmkdir(bpath) @@ -131,7 +131,7 @@ class Server end def getfile(md5, client = nil, clientip = nil) - bpath, bfile, bpaths = FileBucket.paths(@bucket,md5) + bpath, bfile, bpaths = FileBucket.paths(@path,md5) unless FileTest.exists?(bfile) return false |
