diff options
author | Markus Roberts <Markus@reality.com> | 2010-07-19 13:45:10 -0700 |
---|---|---|
committer | Markus Roberts <Markus@reality.com> | 2010-07-19 19:56:05 -0700 |
commit | bbc07f2581fc5475530310d3ee9d3a11c0d32eb5 (patch) | |
tree | 5b3553a3b4319c86f508fda614c2f86a5f6a0d07 /lib | |
parent | 40e6f02dd2ca9a7d8e2f1de00e83c46974b5ec6e (diff) | |
download | puppet-bbc07f2581fc5475530310d3ee9d3a11c0d32eb5.tar.gz puppet-bbc07f2581fc5475530310d3ee9d3a11c0d32eb5.tar.xz puppet-bbc07f2581fc5475530310d3ee9d3a11c0d32eb5.zip |
Bandaid for #4285 -- :name vs <namevar>
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.
Diffstat (limited to 'lib')
-rw-r--r-- | 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 55874aec8..ca7c212a9 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 |