puppetlabs/puppet — pull request #2929 by Sharpie (2014-07-31 19:00:27+00:00)
Title: (PUP-2924) Set resource_type when retrieving state

Instances of `Puppet::Resource` will follow a very expensive code path when
asked to retrieve their `resource_type`. In the case of whits, this results in
an exhaustive search as Whit types have unique per-instance names that never
map to an on-disk implementation as Ruby code.

This patch avoids some of this work by having the `Puppet::Type#retrieve`
method set `resource_type` to `self.class` after creating a Resource instance.