diff options
author | Luke Kanies <luke@madstop.com> | 2008-04-08 02:38:20 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-04-08 11:33:50 -0500 |
commit | 69a321f07dc0cbec7a0471a3378e9330d12c47b7 (patch) | |
tree | 64167cfbda61b43e5802dab97d2f832309a48216 /lib/puppet | |
parent | f9881edd5d4b9f86c1da1c66fb12324d0f9c3c41 (diff) | |
download | puppet-69a321f07dc0cbec7a0471a3378e9330d12c47b7.tar.gz puppet-69a321f07dc0cbec7a0471a3378e9330d12c47b7.tar.xz puppet-69a321f07dc0cbec7a0471a3378e9330d12c47b7.zip |
Fixing the tests that were failing because of the use
of the indirection request object.
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/file_serving/indirection_hooks.rb | 6 |
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 |