Given I create a type Keystone_tenant with composite namevar. Specifically, name and domain are isnamevar parameters.
In the provider I use self.prefetch to find existing resources relative to the catalogue.
In the manifest I have this :
Then in self.prefetch, puppet is passing me this vision of the relevant part of the catalogue:
As you can see, one of the two resources has disappeared from the catalogue. When I run the manifest twice I got a error as puppet try to recreate meaningless_title_one, because I hadn't have a chance to associate it with an existing provider.
The problem is in def resources_by_provider(type_name, provider_name) in lib/puppet/transaction.rb. The code wrongly assumes that the name is the unique key of the resource, which is not the case when using composite namevar.
For reference, I came up with this solution in my prefetch:
The last line creates a unique key suitable for composite namevar. keystone_tenants_keys is the structure I traverse to associate catalogue resource with provider. The whole code is there