[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. puppet-0.24.5-rc3-1601-gf8c1b08

James Turnbull james at lovedthanlost.net
Fri Jan 15 09:07:03 UTC 2010


The following commit has been merged in the upstream branch:
commit 40135609c8cfc7b70369a848a383a687a216f6a7
Author: Brice Figureau <brice-puppet at daysofwonder.com>
Date:   Wed Nov 11 18:29:05 2009 +0100

    Fix #2797 - tags are not inherited by recursed file sub child
    
    This problem affects all types that generate sub-resources at
    evaluation or pre-transaction time.
    Thus it is fixed in the transaction, where we make sure we assign
    all parent tags to the generated child resource.
    
    A more correct fix would be to make sure we copy the whole context
    (ie file, line, version, tags). This fix is planned for Rowlf.
    
    Signed-off-by: Brice Figureau <brice-puppet at daysofwonder.com>

diff --git a/lib/puppet/transaction.rb b/lib/puppet/transaction.rb
index d04856d..8ea8ccd 100644
--- a/lib/puppet/transaction.rb
+++ b/lib/puppet/transaction.rb
@@ -353,6 +353,7 @@ class Transaction
         made = [made] unless made.is_a?(Array)
         made.uniq.find_all do |res|
             begin
+                res.tag(*resource.tags)
                 @catalog.add_resource(res) do |r|
                     r.finish
                     make_parent_child_relationship(resource, [r])
diff --git a/spec/unit/transaction.rb b/spec/unit/transaction.rb
index 7966c7a..4763b98 100755
--- a/spec/unit/transaction.rb
+++ b/spec/unit/transaction.rb
@@ -51,6 +51,21 @@ describe Puppet::Transaction do
 
             @transaction.generate_additional_resources(generator, :generate).should be_empty
         end
+
+        it "should copy all tags to the newly generated resources" do
+            child = stub 'child'
+            generator = stub 'resource', :tags => ["one", "two"]
+
+            @catalog = Puppet::Resource::Catalog.new
+            @transaction = Puppet::Transaction.new(@catalog)
+
+            generator.stubs(:generate).returns [child]
+            @catalog.stubs(:add_resource)
+
+            child.expects(:tag).with("one", "two")
+
+            @transaction.generate_additional_resources(generator, :generate)
+        end
     end
 
     describe "when skipping a resource" do

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list