[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 2.6.1rc1-141-gcdb2b90

Markus Roberts Markus at reality.com
Mon Aug 16 12:48:05 UTC 2010


The following commit has been merged in the upstream branch:
commit 63ec207cc88828b8b0ad421c7fcdd8a5715e7fd3
Author: Markus Roberts <Markus at reality.com>
Date:   Sat Jul 24 10:35:21 2010 -0700

    Minimal fix for #4297, with notes for follow-up
    
    In retrospect it appears that the fix for #4270 was incomplete and somewhat off
    target.  This patch fixes the one demonstrably incorrect part (the namespace)
    and adds a comment outlining what remains to be done to clean up the code;
    these additional changes, while needed for maintanability, are inappropriate
    for a quick turnaround crucial bug fix release such as 2.6.1, at which this
    patch is targeted.

diff --git a/lib/puppet/resource/type.rb b/lib/puppet/resource/type.rb
index 85c0979..6296d26 100644
--- a/lib/puppet/resource/type.rb
+++ b/lib/puppet/resource/type.rb
@@ -174,12 +174,29 @@ class Puppet::Resource::Type
     @name.is_a?(Regexp)
   end
 
+  # MQR TODO:
+  #
+  # The change(s) introduced by the fix for #4270 are mostly silly & should be 
+  # removed, though we didn't realize it at the time.  If it can be established/
+  # ensured that nodes never call parent_type and that resource_types are always
+  # (as they should be) members of exactly one resource_type_collection the 
+  # following method could / should be replaced with:
+  #
+  # def parent_type
+  #   @parent_type ||= parent && (
+  #     resource_type_collection.find_or_load([name],parent,type.to_sym) ||
+  #     fail Puppet::ParseError, "Could not find parent resource type '#{parent}' of type #{type} in #{resource_type_collection.environment}"
+  #   )
+  # end
+  #
+  # ...and then the rest of the changes around passing in scope reverted.
+  #
   def parent_type(scope = nil)
     return nil unless parent
 
     unless @parent_type
       raise "Must pass scope to parent_type when called first time" unless scope
-      unless @parent_type = scope.environment.known_resource_types.send("find_#{type}", scope.namespaces, parent)
+      unless @parent_type = scope.environment.known_resource_types.send("find_#{type}", [name], parent)
         fail Puppet::ParseError, "Could not find parent resource type '#{parent}' of type #{type} in #{scope.environment}"
       end
     end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list