[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. debian/0.24.6-1-356-g5718585

Luke Kanies luke at madstop.com
Fri Jan 23 14:20:59 UTC 2009


The following commit has been merged in the master branch:
commit 0040bc87a1a4afac3a97165cd2e6e3c38f373261
Author: Luke Kanies <luke at madstop.com>
Date:   Wed Sep 24 18:08:06 2008 -0500

    Fixed #1045 - Multiple metaparams all get added to resources.
    
    The problem was that I was using a 'return' in a loop where
    I should have been using a 'next'.
    
    Signed-off-by: Luke Kanies <luke at madstop.com>

diff --git a/CHANGELOG b/CHANGELOG
index 2b61921..94d0581 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,6 @@
 0.24.x
+    Fixed #1045 - Multiple metaparams all get added to resources.
+
     Fixed #1595 - Internally, Property#retrieve is no longer called
     when no 'should' value is available for a resource.
 
diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb
index d214a60..747338b 100644
--- a/lib/puppet/parser/resource.rb
+++ b/lib/puppet/parser/resource.rb
@@ -369,7 +369,7 @@ class Puppet::Parser::Resource
             next unless val = scope.lookupvar(name.to_s, false) and val != :undefined
 
             # The default case: just set the value
-            return set_parameter(name, val) unless @params[name]
+            set_parameter(name, val) and next unless @params[name]
 
             # For relationship params, though, join the values (a la #446).
             @params[name].value = [@params[name].value, val].flatten
diff --git a/spec/unit/parser/resource.rb b/spec/unit/parser/resource.rb
index 6b20219..63cfbc2 100755
--- a/spec/unit/parser/resource.rb
+++ b/spec/unit/parser/resource.rb
@@ -176,6 +176,16 @@ describe Puppet::Parser::Resource do
             @resource["noop"].should == "false"
         end
 
+        it "should copy all metaparams that it finds" do
+            @scope.setvar("require", "container")
+            @scope.setvar("notify", "container")
+
+            @resource.class.publicize_methods(:add_metaparams)  { @resource.add_metaparams }
+
+            @resource["require"].should == "container"
+            @resource["notify"].should == "container"
+        end
+
         it "should stack relationship metaparams from its container if it already has them" do
             @resource.set_parameter("require", "resource")
             @scope.setvar("require", "container")

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list