summaryrefslogtreecommitdiffstats
path: root/lib/puppet/file_serving
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/file_serving')
-rw-r--r--lib/puppet/file_serving/indirection_hooks.rb6
-rw-r--r--lib/puppet/file_serving/metadata.rb9
2 files changed, 4 insertions, 11 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
diff --git a/lib/puppet/file_serving/metadata.rb b/lib/puppet/file_serving/metadata.rb
index 56712122c..beecaef48 100644
--- a/lib/puppet/file_serving/metadata.rb
+++ b/lib/puppet/file_serving/metadata.rb
@@ -11,15 +11,6 @@ require 'puppet/file_serving/indirection_hooks'
# A class that handles retrieving file metadata.
class Puppet::FileServing::Metadata < Puppet::FileServing::FileBase
- module MetadataHelper
- include Puppet::FileServing::IndirectionHooks
-
- def post_find(instance)
- end
-
- def post_search(key, options = {})
- end
- end
include Puppet::Util::Checksums