[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Daniel Pittman daniel at puppetlabs.com
Tue May 10 08:18:57 UTC 2011


The following commit has been merged in the experimental branch:
commit a4a274b8c7807fdf35199dc20889de599ea912ca
Author: Daniel Pittman <daniel at puppetlabs.com>
Date:   Mon May 2 12:46:09 2011 -0700

    (#7315) Fix `to_pson` method to render correctly.
    
    Puppet::Status had an outdated implementation of the `to_pson` hook, so would
    fail to render when asked.  Changes to the faces system exposed this,
    resulting in a backtrace if the user wanted JSON output on the CLI.
    
    Reviewed-By: Nick Lewis <nick at puppetlabs.com>

diff --git a/lib/puppet/status.rb b/lib/puppet/status.rb
index eecd0e1..ea6a601 100644
--- a/lib/puppet/status.rb
+++ b/lib/puppet/status.rb
@@ -10,7 +10,7 @@ class Puppet::Status
     @status = status || {"is_alive" => true}
   end
 
-  def to_pson
+  def to_pson(*args)
     @status.to_pson
   end
 
diff --git a/spec/unit/status_spec.rb b/spec/unit/status_spec.rb
index 8208076..0c572fd 100755
--- a/spec/unit/status_spec.rb
+++ b/spec/unit/status_spec.rb
@@ -15,6 +15,10 @@ describe Puppet::Status do
     Puppet::Status.new.status.to_pson.should == '{"is_alive":true}'
   end
 
+  it "should render to a pson hash" do
+    PSON::pretty_generate(Puppet::Status.new).should =~ /"is_alive":\s*true/
+  end
+
   it "should accept a hash from pson" do
     status = Puppet::Status.new( { "is_alive" => false } )
     status.status.should == { "is_alive" => false }

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list