| Class | Puppet::Resource::Type |
| In: |
lib/puppet/resource/type.rb
|
| Parent: | Object |
| ResourceType | = | self |
| RESOURCE_SUPERTYPES | = | [:hostclass, :node, :definition] |
| arguments | [R] | |
| behaves_like | [R] | |
| code | [RW] | |
| doc | [RW] | |
| file | [RW] | |
| line | [RW] | |
| module_name | [RW] | |
| namespace | [R] | |
| parent | [RW] | |
| resource_type_collection | [RW] | |
| ruby_code | [RW] | |
| type | [R] |
Make an instance of the resource type, and place it in the catalog if it isn‘t in the catalog already. This is only possible for classes and nodes. No parameters are be supplied—if this is a parameterized class, then all parameters take on their default values.
MQR TODO:
The change(s) introduced by the fix for 4270 are mostly silly & should be removed, though we didn‘t realize it at the time. If it can be established/ ensured that nodes never call parent_type and that resource_types are always (as they should be) members of exactly one resource_type_collection the following method could / should be replaced with:
def parent_type
@parent_type ||= parent && (
resource_type_collection.find_or_load([name],parent,type.to_sym) ||
fail Puppet::ParseError, "Could not find parent resource type '#{parent}' of type #{type} in #{resource_type_collection.environment}"
)
end
…and then the rest of the changes around passing in scope reverted.