[chef] Re: Re: partial search


Chronological Thread 
  • From: Jesse Campbell < >
  • To: chef < >
  • Subject: [chef] Re: Re: partial search
  • Date: Wed, 13 Feb 2013 19:20:09 -0500

I disagree. Search returns a json serialized node object, which can be turned back into a node. Partial search returns json strings and arrays of strings.

Not to be difficult, but I've just done it, and that is the result. From a search, you can do result.run_list[0].name whereas from a partial search you must to result['data']['run_list'][0] and the .name, .type, and .version are collapsed to just a single string.

-Jesse


the thing you get back from search is the json-serialized representation of the node, not the chef node ruby object.

search or partial_search always gives similar results to knife search:

knife search node '*:*' -a run_list -Fj

On 2/13/13 2:35 PM, Jesse Campbell wrote:
Valid point
but node.run_list is a Chef::RunList, which can be treated like a hash that contains name, version, type.
there is no way i can see in partial search to get this object.




On Wed, Feb 13, 2013 at 5:23 PM, Noah Kantrowitz < " target="_blank"> > wrote:
The run list is not an array of hashes, it is stored as an array like ['role[foo]', ...]

--Noah




Archive powered by MHonArc 2.6.16.

§