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


The following commit has been merged in the upstream branch:
commit ff23b5762532ef9bec84f0ad5cb32c807e048b90
Author: Bruce Williams <bruce at codefluency.com>
Date:   Thu Nov 5 10:57:48 2009 -0800

    Fix for #2670, Puppet silently ignores catalog_format
    
    Since "preferred_serialization_format" was introduced, the older
    "catalog_format" setting (yaml|marshal), when provided, has been
    silently ignored and the default for "preferred_serialization_format"
    used.  This re-introduces "catalog_format," logs a deprecation notice,
    and passes on any provided value to "preferred_serialization_format."
    
    Signed-off-by: Bruce Williams <bruce at codefluency.com>

diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index 4924f2c..f128e60 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -522,6 +522,18 @@ module Puppet
             authority requests.  It's a separate server because it cannot
             and does not need to horizontally scale."],
         :ca_port => ["$masterport", "The port to use for the certificate authority."],
+        :catalog_format => {
+            :default => "",
+            :desc => "(Deprecated for 'preferred_serialization_format') What format to
+                     use to dump the catalog.  Only supports 'marshal' and 'yaml'.  Only
+                     matters on the client, since it asks the server for a specific format.",
+            :hook => proc { |value|
+                if value
+                    Puppet.warning "Setting 'catalog_format' is deprecated; use 'preferred_serialization_format' instead."
+                    Puppet.settings[:preferred_serialization_format] = value
+                end
+            }
+        },
         :preferred_serialization_format => ["pson", "The preferred means of serializing
             ruby instances for passing over the wire.  This won't guarantee that all
             instances will be serialized using this method, since not all classes
diff --git a/spec/integration/defaults.rb b/spec/integration/defaults.rb
index fb00f86..292abbb 100755
--- a/spec/integration/defaults.rb
+++ b/spec/integration/defaults.rb
@@ -29,6 +29,17 @@ describe "Puppet defaults" do
         end
     end
 
+    describe "when setting the :catalog_format" do
+        it "should log a deprecation notice" do
+            Puppet.expects(:warning)
+            Puppet.settings[:catalog_format] = 'marshal'
+        end
+        it "should copy the value to :preferred_serialization_format" do
+            Puppet.settings[:catalog_format] = 'marshal'
+            Puppet.settings[:preferred_serialization_format].should == 'marshal'
+        end
+    end
+
     it "should have a clientyamldir setting" do
         Puppet.settings[:clientyamldir].should_not be_nil
     end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list