summaryrefslogtreecommitdiffstats
path: root/lib/puppet/file_serving/indirection_hooks.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/file_serving/indirection_hooks.rb')
-rw-r--r--lib/puppet/file_serving/indirection_hooks.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/puppet/file_serving/indirection_hooks.rb b/lib/puppet/file_serving/indirection_hooks.rb
index 141642efe..66ed169dc 100644
--- a/lib/puppet/file_serving/indirection_hooks.rb
+++ b/lib/puppet/file_serving/indirection_hooks.rb
@@ -12,7 +12,8 @@ module Puppet::FileServing::IndirectionHooks
PROTOCOL_MAP = {"puppet" => :rest, "file" => :file, "puppetmounts" => :file_server}
# Pick an appropriate terminus based on the protocol.
- def select_terminus(full_uri, options = {})
+ def select_terminus(request)
+ full_uri = request.key
# Short-circuit to :file if it's a fully-qualified path.
return PROTOCOL_MAP["file"] if full_uri =~ /^#{::File::SEPARATOR}/
begin
@@ -29,11 +30,12 @@ module Puppet::FileServing::IndirectionHooks
terminus = :file_server
end
+ # This is the backward-compatible module terminus.
if terminus == :file_server and uri.path =~ %r{^/([^/]+)\b}
modname = $1
if modname == "modules"
terminus = :modules
- elsif terminus(:modules).find_module(modname, options[:node])
+ elsif terminus(:modules).find_module(modname, request.options[:node])
Puppet.warning "DEPRECATION NOTICE: Found file '%s' in module without using the 'modules' mount; please prefix path with '/modules'" % uri.path
terminus = :modules
end