[chef] Re: Re: knife node show json format squished


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: Re: knife node show json format squished
  • Date: Thu, 13 Jun 2013 08:46:07 -0700


On Wednesday, June 12, 2013 at 8:28 PM, John Alberts wrote:

me too!  I've noticed this recently too.  I'm not really sure when it started happening, so I can't really offer any details that would be helpful.  I'd love to hear if you find a solution.

-bash-3.2# which ruby
/usr/local/bin/ruby
-bash-3.2# ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
-bash-3.2# gem list chef

*** LOCAL GEMS ***

chef (10.26.0, 10.24.4, 10.18.0, 10.16.2, 0.10.8, 0.10.4, 0.10.0)
chef-expander (10.26.0, 10.24.4, 10.18.0, 10.16.2, 0.10.8, 0.10.4, 0.10.0)
chef-server (10.26.0, 10.24.4, 10.18.0, 10.16.2, 0.10.8, 0.10.4, 0.10.0)
chef-server-api (10.26.0, 10.24.4, 10.18.0, 10.16.2, 0.10.8, 0.10.4, 0.10.0)
chef-server-webui (10.26.0, 10.24.4, 10.18.0, 10.16.2, 0.10.8, 0.10.4, 0.10.0)
chef-solr (10.26.0, 10.24.4, 10.18.0, 10.16.2, 0.10.8, 0.10.4, 0.10.0)

Yes, yes, I know. I should clean these old gems up. :)

John


On Wed, Jun 12, 2013 at 8:35 PM, < " target="_blank"> > wrote:

Recently the node output I see went from a nice "fully-expanded" view of the
json to the json being not expanded, being "squished"... for lack of better
phrasing.

Does anyone happen to know what happened, or how to get the output back to
fully-expanded?

I can't think of any changes to the relevant code in Chef recently that would cause this. The code path is:

Knife uses a presenter object to convert your data to a string: https://github.com/opscode/chef/blob/master/lib/chef/knife/core/generic_presenter.rb#L81

Chef adds some options for nesting levels, then calls JSON.pretty_generate https://github.com/opscode/chef/blob/master/lib/chef/json_compat.rb#L105

I have 11.4.2 installed locally and it's correctly "pretty printing" the json, so there must be something different in your setup.

-- 
Daniel DeLeo




Archive powered by MHonArc 2.6.16.

§