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 24 def find(request) 25 mount, relative_path = configuration.split_path(request) 26 27 return nil unless mount 28 29 # The mount checks to see if the file exists, and returns nil 30 # if not. 31 path = mount.find(relative_path, request) 32 return nil unless path 33 path2instance(request, path) 34 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 38 def search(request) 39 mount, relative_path = configuration.split_path(request) 40 41 paths = mount.search(relative_path, request) if mount 42 unless paths 43 Puppet.info _("Could not find filesystem info for file '%{request}' in environment %{env}") % { request: request.key, env: request.environment } 44 return nil 45 end 46 path2instances(request, *paths) 47 end
Private Instance Methods
configuration()
click to toggle source
Our fileserver configuration, if needed.
# File lib/puppet/indirector/file_server.rb 52 def configuration 53 Puppet::FileServing::Configuration.configuration 54 end