# File lib/puppet/type.rb, line 991
 991:     def self.instances
 992:         if provider_hash.empty?
 993:             raise Puppet::DevError, "%s has no providers and has not overridden 'instances'" % self.name
 994:         end
 995: 
 996:         # Put the default provider first, then the rest of the suitable providers.
 997:         provider_instances = {}
 998:         providers_by_source.collect do |provider|
 999:             provider.instances.collect do |instance|
1000:                 # We always want to use the "first" provider instance we find, unless the resource
1001:                 # is already managed and has a different provider set
1002:                 if other = provider_instances[instance.name]
1003:                     Puppet.warning "%s %s found in both %s and %s; skipping the %s version" %
1004:                         [self.name.to_s.capitalize, instance.name, other.class.name, instance.class.name, instance.class.name]
1005:                     next
1006:                 end
1007:                 provider_instances[instance.name] = instance
1008: 
1009:                 new(:name => instance.name, :provider => instance, :check => :all)
1010:             end
1011:         end.flatten.compact
1012:     end