[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-663-g71824ee

Markus Roberts Markus at reality.com
Tue Jul 20 07:42:36 UTC 2010


The following commit has been merged in the upstream branch:
commit bbc07f2581fc5475530310d3ee9d3a11c0d32eb5
Author: Markus Roberts <Markus at reality.com>
Date:   Mon Jul 19 13:45:10 2010 -0700

    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.

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

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list