You can always just manually instantiate RunList, the same way Node#initialize works :) the automated casting to an actual node object is a feature of the ruby json library, not chef itself.Jesse Campbell < " target="_blank"> > wrote: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:
there is no way i can see in partial search to get this object.Valid pointbut node.run_list is a Chef::RunList, which can be treated like a hash that contains name, version, type.
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.