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


The following commit has been merged in the upstream branch:
commit 342298c4f9fcb2874d4017219a472ddf37dbfc6b
Author: Jesse Wolfe <jes5199 at gmail.com>
Date:   Wed May 12 18:32:39 2010 -0700

    Bug: Broken codepath in util/settings
    
    An incorrect variable name is used in an error message, causing the
    error to throw an error.
    This can't appear in the wild, since it's actually just an argument
    check for the defaults.rb file.
    
    Signed-off-by: Jesse Wolfe <jes5199 at gmail.com>

diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb
index 4d5acbe..ea18d22 100644
--- a/lib/puppet/util/settings.rb
+++ b/lib/puppet/util/settings.rb
@@ -386,7 +386,7 @@ class Puppet::Util::Settings
             when String, Integer, Float # nothing
                 klass = Setting
             else
-                raise Puppet::Error, "Invalid value '%s' for %s" % [value.inspect, hash[:name]]
+                raise ArgumentError, "Invalid value '%s' for %s" % [hash[:default].inspect, hash[:name]]
             end
         end
         hash[:settings] = self
diff --git a/spec/unit/util/settings.rb b/spec/unit/util/settings.rb
index 3eba6dd..afdcf62 100755
--- a/spec/unit/util/settings.rb
+++ b/spec/unit/util/settings.rb
@@ -38,6 +38,10 @@ describe Puppet::Util::Settings do
             lambda { @settings.setdefaults(:section, :myvalue => {:default => "a value"}) }.should raise_error(ArgumentError)
         end
 
+        it "should raise an error if we can't guess the type" do
+            lambda { @settings.setdefaults(:section, :myvalue => {:default => Object.new, :desc => "An impossible object"}) }.should raise_error(ArgumentError)
+        end
+
         it "should support specifying owner, group, and mode when specifying files" do
             @settings.setdefaults(:section, :myvalue => {:default => "/some/file", :owner => "service", :mode => "boo", :group => "service", :desc => "whatever"})
         end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list