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

test branch puppet-dev at googlegroups.com
Wed Jul 14 10:33:36 UTC 2010


The following commit has been merged in the upstream branch:
commit 3dfb7626fdc775803b94b0e009ece41198acde29
Author: Luke Kanies <luke at puppetlabs.com>
Date:   Mon May 17 12:04:40 2010 -0700

    Fixing Catalog conversion
    
    Parser resources were not correctly being converted
    to Puppet::Resource instances, which meant a ton more
    information was being kept in the catalog.
    
    This probably didn't have much affect in real life, because
    of how we serialized, but it made debugging a lot harder.
    
    Signed-off-by: Luke Kanies <luke at puppetlabs.com>

diff --git a/lib/puppet/resource/catalog.rb b/lib/puppet/resource/catalog.rb
index 97c036b..3a28f45 100644
--- a/lib/puppet/resource/catalog.rb
+++ b/lib/puppet/resource/catalog.rb
@@ -551,7 +551,7 @@ class Puppet::Resource::Catalog < Puppet::SimpleGraph
             #Aliases aren't working in the ral catalog because the current instance of the resource
             #has a reference to the catalog being converted. . . So, give it a reference to the new one
             #problem solved. . .
-            if resource.is_a?(Puppet::Resource)
+            if resource.class == Puppet::Resource
                 resource = resource.dup
                 resource.catalog = result
             elsif resource.is_a?(Puppet::TransObject)
diff --git a/spec/unit/resource/catalog.rb b/spec/unit/resource/catalog.rb
index a7caf09..3020dc8 100755
--- a/spec/unit/resource/catalog.rb
+++ b/spec/unit/resource/catalog.rb
@@ -207,6 +207,14 @@ describe Puppet::Resource::Catalog, "when compiling" do
             @original.to_resource.version.should == "foo"
         end
 
+        it "should convert parser resources to plain resources" do
+            resource = Puppet::Parser::Resource.new(:file, "foo", :scope => stub("scope"), :source => stub("source"))
+            catalog = Puppet::Resource::Catalog.new("whev")
+            catalog.add_resource(resource)
+            new = catalog.to_resource
+            new.resource(:file, "foo").class.should == Puppet::Resource
+        end
+
         it "should add all resources as Puppet::Resource instances" do
             @resources.each { |resource| @catalog.resource(resource.ref).should be_instance_of(Puppet::Resource) }
         end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list