summaryrefslogtreecommitdiffstats
path: root/lib/puppet/resource.rb
diff options
context:
space:
mode:
authorMarkus Roberts <Markus@reality.com>2010-06-28 12:00:55 -0700
committerMarkus Roberts <Markus@reality.com>2010-06-28 12:18:25 -0700
commit9afc67a465f030a2a1cad0e7ec58e30862f28b4d (patch)
treeec1b5ad5558a3ed2264eb44ee7cfae7232e4426f /lib/puppet/resource.rb
parentd62a391695bd68464ba7345616cc1e7686f8f735 (diff)
downloadpuppet-9afc67a465f030a2a1cad0e7ec58e30862f28b4d.tar.gz
puppet-9afc67a465f030a2a1cad0e7ec58e30862f28b4d.tar.xz
puppet-9afc67a465f030a2a1cad0e7ec58e30862f28b4d.zip
Fix for pre 1.8.7 compatibility in namvar patch
There was a subtle 1.8.7 dependence in the composite key / namevar patch; Nick discovered that our assumtion that hashes could be used as hash keys does not hold in earlier bersions of ruby. This patch replaces the hash valued uniqueness_key with an array of the values of the (ordered) key attributes.
Diffstat (limited to 'lib/puppet/resource.rb')
-rw-r--r--lib/puppet/resource.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/puppet/resource.rb b/lib/puppet/resource.rb
index 6ffaa2f3b..393211e09 100644
--- a/lib/puppet/resource.rb
+++ b/lib/puppet/resource.rb
@@ -213,11 +213,7 @@ class Puppet::Resource
end
def uniqueness_key
- h = {}
- key_attributes.each do |attribute|
- h[attribute] = self.to_hash[attribute]
- end
- return h
+ self.to_hash.values_at(*key_attributes.sort_by { |k| k.to_s })
end
def key_attributes