[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:35 UTC 2010


The following commit has been merged in the upstream branch:
commit 047ebfee96aa6c9471883a71fef4f3a4086cd149
Author: Luke Kanies <luke at puppetlabs.com>
Date:   Tue Apr 13 12:04:18 2010 -0700

    Fixing Parser::Resource param validation
    
    It was previously not allowing false values.
    
    Signed-off-by: Luke Kanies <luke at puppetlabs.com>

diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb
index 1ae065f..3e01224 100644
--- a/lib/puppet/parser/resource.rb
+++ b/lib/puppet/parser/resource.rb
@@ -168,7 +168,7 @@ class Puppet::Parser::Resource < Puppet::Resource
     # if we ever receive a parameter named 'tag', set
     # the resource tags with its value.
     def set_parameter(param, value = nil)
-        if value
+        if ! value.nil?
             param = Puppet::Parser::Resource::Param.new(
                 :name => param, :value => value, :source => self.source
             )
diff --git a/spec/unit/parser/resource.rb b/spec/unit/parser/resource.rb
index ca73bfb..5b2a16a 100755
--- a/spec/unit/parser/resource.rb
+++ b/spec/unit/parser/resource.rb
@@ -580,6 +580,11 @@ describe Puppet::Parser::Resource do
             lambda { @resource.set_parameter("myparam") }.should raise_error(ArgumentError)
         end
 
+        it "should allow parameters to be set to 'false'" do
+            @resource.set_parameter("myparam", false)
+            @resource["myparam"].should be_false
+        end
+
         it "should use its source when provided a parameter name and value" do
             @resource.set_parameter("myparam", "myvalue")
             @resource["myparam"].should == "myvalue"

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list