berkshelf / ridley

A reliable Chef API client with a clean syntax
Other
231 stars 84 forks source link

ridley.node.all return wrong data. #238

Closed ctrlok closed 10 years ago

ctrlok commented 10 years ago

Hi. Have some problem with node.all:

1.9.3-p448 :004 > ridley.node.all[3]
 => #<Ridley::NodeObject chef_id:node.example.com, attributes:#<VariaModel::Attributes automatic=#<Hashie::Mash> chef_environment="_default" chef_type="node" default=#<Hashie::Mash> json_class="Chef::Node" name="p2.grammarly.com" normal=#<Hashie::Mash> override=#<Hashie::Mash> run_list=[]>>

But this node has not emply runlist and other env. If I use ridley.search(:node) - all ok. Thanks.

reset commented 10 years ago

@ctrlok you have to send the #reload message to node objects returned from a full listing. Their attributes aren't automatically populated from the initial search.

irb> node = ridley.node.all[3]
irb> node.reload