[chef] Re: Re: Fwd: Unable to use data bag


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: Re: Fwd: Unable to use data bag
  • Date: Mon, 30 Sep 2013 10:46:52 -0700


On Monday, September 30, 2013 at 10:43 AM, Cassiano Leal wrote:

Hey,

The error you’re getting is because when you do 

bag   = search( :rollups, which )  

the bag object is an Array, not a Hash.
debugging tip on this, try using `pp` instead of `puts`. Chef usually has `pp` loaded (it's in the ruby stdlib, not core) so if it doesn't work you need to do `require 'pp'` first.

Anyway, `pp` "pretty prints" objects; if they're core ruby data structures, like Hash or Array, they'll get printed out exactly how you would type them.


-- 
Daniel DeLeo




Archive powered by MHonArc 2.6.16.

§