summaryrefslogtreecommitdiffstats
path: root/lib/puppet/server
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-12-27 18:20:37 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-12-27 18:20:37 +0000
commit92ff7121ec656b36815b14533fba5e92c165eb08 (patch)
tree3bf068822a983aba185db9366ccbba846005e594 /lib/puppet/server
parent8ff7e0c75eda0291a169074c67fa0a90db9c4e7b (diff)
downloadpuppet-92ff7121ec656b36815b14533fba5e92c165eb08.tar.gz
puppet-92ff7121ec656b36815b14533fba5e92c165eb08.tar.xz
puppet-92ff7121ec656b36815b14533fba5e92c165eb08.zip
Fixing #365. I am not sure what the problem was in previous versions, because the new graphing stuff changed the solution to this problem, but it all works now.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1972 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/server')
-rwxr-xr-xlib/puppet/server/filebucket.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/puppet/server/filebucket.rb b/lib/puppet/server/filebucket.rb
index 3fd4a8f5f..fa86e970b 100755
--- a/lib/puppet/server/filebucket.rb
+++ b/lib/puppet/server/filebucket.rb
@@ -64,8 +64,10 @@ class Server
end
# accept a file from a client
- def addfile(string,path, client = nil, clientip = nil)
- contents = Base64.decode64(string)
+ def addfile(contents, path, client = nil, clientip = nil)
+ if client
+ contents = Base64.decode64(contents)
+ end
md5 = Digest::MD5.hexdigest(contents)
bpath, bfile, pathpath = FileBucket.paths(@path,md5)
@@ -141,8 +143,12 @@ class Server
File.open(bfile) { |of|
contents = of.read
}
-
- return Base64.encode64(contents)
+
+ if client
+ return Base64.encode64(contents)
+ else
+ return contents
+ end
end
def to_s