class Puppet::Indirector::FileServer
Look files up using the file server.
Public Instance Methods
find(request)
click to toggle source
Find our key using the fileserver.
# File lib/puppet/indirector/file_server.rb 23 def find(request) 24 mount, relative_path = configuration.split_path(request) 25 26 return nil unless mount 27 28 # The mount checks to see if the file exists, and returns nil 29 # if not. 30 path = mount.find(relative_path, request) 31 return nil unless path 32 path2instance(request, path) 33 end
search(request)
click to toggle source
Search for files. This returns an array rather than a single file.
# File lib/puppet/indirector/file_server.rb 37 def search(request) 38 mount, relative_path = configuration.split_path(request) 39 40 paths = mount.search(relative_path, request) if mount 41 unless paths 42 Puppet.info _("Could not find filesystem info for file '%{request}' in environment %{env}") % { request: request.key, env: request.environment } 43 return nil 44 end 45 path2instances(request, *paths) 46 end
Private Instance Methods
configuration()
click to toggle source
Our fileserver configuration, if needed.
# File lib/puppet/indirector/file_server.rb 51 def configuration 52 Puppet::FileServing::Configuration.configuration 53 end