We sometimes refer to the namevar as its name and sometimes as :name; there is no consistant pattern in the code for when this is done one way or the other. This problem was exposed by the composite namevar refactor; the present patch adjusts the crucial routine to work with either.
Signed-off-by: Markus Roberts <[email protected]> --- lib/puppet/resource.rb | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/lib/puppet/resource.rb b/lib/puppet/resource.rb index 55874ae..ca7c212 100644 --- a/lib/puppet/resource.rb +++ b/lib/puppet/resource.rb @@ -217,7 +217,11 @@ class Puppet::Resource end def uniqueness_key - self.to_hash.values_at(*key_attributes.sort_by { |k| k.to_s }) + # Temporary kludge to deal with inconsistant use patters + h = self.to_hash + h[namevar] ||= h[:name] + h[:name] ||= h[namevar] + h.values_at(*key_attributes.sort_by { |k| k.to_s }) end def key_attributes -- 1.6.4 -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
