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 <[email protected]>
---
 lib/puppet/status.rb     |    2 +-
 spec/unit/status_spec.rb |    4 ++++
 2 files changed, 5 insertions(+), 1 deletions(-)

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 }
-- 
1.7.5

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to