summaryrefslogtreecommitdiffstats
path: root/lib/puppet/file_serving
diff options
context:
space:
mode:
authorBrice Figureau <brice-puppet@daysofwonder.com>2009-07-18 15:34:44 +0200
committerBrice Figureau <brice-puppet@daysofwonder.com>2009-07-18 15:34:44 +0200
commit8bbd8b4bb295fee7ad99f6137c9851528f1729cc (patch)
tree2b9739774718813a0c32836e2ba9d2b15b4fd19b /lib/puppet/file_serving
parenteffaf80ae662076e3578c3eb7a18b863ef104bb4 (diff)
downloadpuppet-8bbd8b4bb295fee7ad99f6137c9851528f1729cc.tar.gz
puppet-8bbd8b4bb295fee7ad99f6137c9851528f1729cc.tar.xz
puppet-8bbd8b4bb295fee7ad99f6137c9851528f1729cc.zip
Fix #2424 - File server can't find module in environment
Actually, the issue is: * when the web server gets the request, it creates an indirection request, filling attributes like ip or node from the HTTP request. To do this, all the interesting attributes are given in a hash (called options, see P::I::Request#new). Once the request is properly initialized the options hash doesn't contain the ip or node information (see set_attributes) * the request is then transmitted to the file_serving layer, which happily wants to use the node attribute to find environments or perform authorization. Unfortunately it fetches the node value from the request options hash, not the request itself. Since this node information is empty, puppet fails to find the proper mount point, and fails the download. This change makes sure we pass all the way down the node and fix the authorization check. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'lib/puppet/file_serving')
-rw-r--r--lib/puppet/file_serving/configuration.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/file_serving/configuration.rb b/lib/puppet/file_serving/configuration.rb
index cb6cc3634..6f36d2750 100644
--- a/lib/puppet/file_serving/configuration.rb
+++ b/lib/puppet/file_serving/configuration.rb
@@ -72,7 +72,7 @@ class Puppet::FileServing::Configuration
raise(ArgumentError, "Cannot find file: Invalid path '%s'" % mount_name) unless mount_name =~ %r{^[-\w]+$}
- return nil unless mount = find_mount(mount_name, request.options[:node])
+ return nil unless mount = find_mount(mount_name, request.node)
if mount.name == "modules" and mount_name != "modules"
# yay backward-compatibility
path = "%s/%s" % [mount_name, path]