Open
Description
Example for how this is currently used/implemented:
def get_config(instance = resource[:instance])
config_resc = resource.catalog.resources.find do |resc|
resc.title =~ %r{Sqlserver::Config} &&
resc.original_parameters[:instance_name] =~ %r{#{instance}}i
end
if config_resc.nil?
raise("Sqlserver_tsql[#{resource.title}] was unable to retrieve the config, please ensure the catalog contains sqlserver::config{'#{resource[:instance]}':}")
end
config_resc.original_parameters
end
Puppet::Type
's resource.catalog.resources
provides access to other resources in the current catalog.
Possible implementation:
- Add a
raw_catalog_access
feature flag to - add
catalog
accessor to - pass reference to
resource.catalog
to context every time one is created iff theraw_catalog_access
feature is declared on the type definitionpuppet-resource_api/lib/puppet/resource_api.rb
Lines 428 to 434 in bd93dba
resource.catalog
is not available at the class level- add pass through here:
- adjust testing for these changes
- update docs