summaryrefslogtreecommitdiffstats
path: root/lib/puppet/file_serving
diff options
context:
space:
mode:
authorBrice Figureau <brice-puppet@daysofwonder.com>2010-04-10 16:30:03 +0200
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commitee5d7f196fa62046f8fc3d3d723da608b17ce531 (patch)
treeaa92df8067b573167034d62e08c6dbe4c0d35b47 /lib/puppet/file_serving
parent63c122f397c915cb1bec1a645958c808da92dce4 (diff)
downloadpuppet-ee5d7f196fa62046f8fc3d3d723da608b17ce531.tar.gz
puppet-ee5d7f196fa62046f8fc3d3d723da608b17ce531.tar.xz
puppet-ee5d7f196fa62046f8fc3d3d723da608b17ce531.zip
Add master side file content streaming
This patch allows the puppetmaster to serve file chunks by chunks without ever reading the file content in RAM. This allows serving large files directly with the master without impacting the master memory footprint. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'lib/puppet/file_serving')
-rw-r--r--lib/puppet/file_serving/content.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/puppet/file_serving/content.rb b/lib/puppet/file_serving/content.rb
index 9fc1d08b3..87ef4fbbf 100644
--- a/lib/puppet/file_serving/content.rb
+++ b/lib/puppet/file_serving/content.rb
@@ -26,10 +26,11 @@ class Puppet::FileServing::Content < Puppet::FileServing::Base
instance
end
- # Collect our data.
+ # BF: we used to fetch the file content here, but this is counter-productive
+ # for puppetmaster streaming of file content. So collect just returns itself
def collect
return if stat.ftype == "directory"
- content
+ self
end
# Read the content of our file in.
@@ -44,6 +45,6 @@ class Puppet::FileServing::Content < Puppet::FileServing::Base
end
def to_raw
- content
+ File.new(full_path(), "r")
end
end