Method: Puppet::Provider::ParsedFile.targets

Defined in:
lib/vendor/puppet/provider/parsedfile.rb

.targets(resources = nil) ⇒ Object

Find a list of all of the targets that we should be reading. This is used to figure out what targets we need to prefetch.

Raises:



281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# File 'lib/vendor/puppet/provider/parsedfile.rb', line 281

def self.targets(resources = nil)
  targets = []
  # First get the default target
  raise Puppet::DevError, "Parsed Providers must define a default target" unless self.default_target
  targets << self.default_target

  # Then get each of the file objects
  targets += @target_objects.keys

  # Lastly, check the file from any resource instances
  if resources
    resources.each do |name, resource|
      if value = resource.should(:target)
        targets << value
      end
    end
  end

  targets.uniq.compact
end