puppetlabs/puppet — pull request #562 by stschulte (2012-03-05 22:01:58+00:00)
Title: (#12960) Fix puppet resource <type> if type has no providers

puppet resource type calls the instances method of the type class. The
instances method then calls providers_by_source which can fail if the
following conditions are true

1) there is at least one provider defined for the type
2) all providers are unsuitable

If both requirements are met, the method self.defaultprovider will
return nil and we get the following error message (provided by Ben Ford)

# puppet resource maillist
puppet/type.rb:902:in `providers_by_source': undefined method `source'
for nil:NilClass (NoMethodError)

The fix handles the case where defaultprovider can be nil