Details
-
Bug
-
Status: Accepted
-
Normal
-
Resolution: Unresolved
-
None
-
None
-
None
-
Windows 10
Puppet Gem 5.3.3
Registry Module PR - https://github.com/puppetlabs/puppetlabs-registry/pull/142
-
Coremunity
-
Inspection
-
Needs Assessment
Description
I have a custom type called registry_key with an eval_generate method which can purge values. The resource types created by eval_generate are registry_value which is now a type with compound namevars. When creating an instance of the type, it is required to pass a title (compound namevar types appear to need something simple as a resource key)
This is fine and all works ok.... however in a proper puppet run the generated resources do not appear in the catalog correctly.
I've tracked it down to:
https://github.com/puppetlabs/puppet/blob/master/lib/puppet/transaction/additional_resource_generator.rb#L66
made = Hash[generated.map(&:name).zip(generated)]
|
It appears that this code takes each resources :name method and does "something" with it. The issue becomes that the compound namevar types return `nil` for it's name which then screws up the catalog.
After digging into the Puppet::Type type I found a commit (https://github.com/puppetlabs/puppet/commit/607d7c6afec7ab73203382676cc98b6d52898e1d) from Luke back in 2006 which was converting the Puppet::Type name method into title. It appears that additional_resource_generator.rb was never updated to reflect this.
Also there are quotes in the code from that commit
+ # For now, leave the 'name' method functioning like it used to. Once 'title'
|
+ # works everywhere, I'll switch it.
|
Currently:
https://github.com/puppetlabs/puppet/blob/master/lib/puppet/type.rb#L2535-L2543
Would it be safe to switch it now after 12 years?
Attachments
Issue Links
- relates to
-
MODULES-2957 Registry - Cannot manage registry values that have "\" as part of the name
-
- Resolved
-