diff options
author | Luke Kanies <luke@madstop.com> | 2008-07-29 00:46:11 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-07-29 00:46:11 -0500 |
commit | 40375a8fc34dbd85d87f507ba72c7394b25b7271 (patch) | |
tree | efd5a93980b042b73322bd31e6fdb41203d07576 /lib/puppet/indirector/file_server.rb | |
parent | 93eeff59d807261ed154cc104e318ae604602430 (diff) | |
parent | 8f5800f0608dff46407cb5f23ee73f314fe051e8 (diff) | |
download | puppet-40375a8fc34dbd85d87f507ba72c7394b25b7271.tar.gz puppet-40375a8fc34dbd85d87f507ba72c7394b25b7271.tar.xz puppet-40375a8fc34dbd85d87f507ba72c7394b25b7271.zip |
Merge branch '0.24.x' into merging
Conflicts:
test/ral/type/filesources.rb
Diffstat (limited to 'lib/puppet/indirector/file_server.rb')
-rw-r--r-- | lib/puppet/indirector/file_server.rb | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/puppet/indirector/file_server.rb b/lib/puppet/indirector/file_server.rb index 2eb323d46..b0df7ff5d 100644 --- a/lib/puppet/indirector/file_server.rb +++ b/lib/puppet/indirector/file_server.rb @@ -14,28 +14,28 @@ class Puppet::Indirector::FileServer < Puppet::Indirector::Terminus include Puppet::FileServing::TerminusHelper # Is the client authorized to perform this action? - def authorized?(method, key, options = {}) - return false unless [:find, :search].include?(method) + def authorized?(request) + return false unless [:find, :search].include?(request.method) - uri = key2uri(key) + uri = key2uri(request.key) - configuration.authorized?(uri.path, :node => options[:node], :ipaddress => options[:ipaddress]) + configuration.authorized?(uri.path, :node => request.node, :ipaddress => request.ip) end # Find our key using the fileserver. - def find(key, options = {}) - return nil unless path = find_path(key, options) - result = model.new(key, :path => path) - result.links = options[:links] if options[:links] + def find(request) + return nil unless path = find_path(request) + result = model.new(request.key, :path => path) + result.links = request.options[:links] if request.options[:links] return result end # Search for files. This returns an array rather than a single # file. - def search(key, options = {}) - return nil unless path = find_path(key, options) + def search(request) + return nil unless path = find_path(request) - path2instances(key, path, options) + path2instances(request, path) end private @@ -46,10 +46,10 @@ class Puppet::Indirector::FileServer < Puppet::Indirector::Terminus end # Find our path; used by :find and :search. - def find_path(key, options) - uri = key2uri(key) + def find_path(request) + uri = key2uri(request.key) - return nil unless path = configuration.file_path(uri.path, :node => options[:node]) + return nil unless path = configuration.file_path(uri.path, :node => request.node) return path end |