Skip to content

Instantly share code, notes, and snippets.

@textgoeshere
Created September 16, 2010 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save textgoeshere/582266 to your computer and use it in GitHub Desktop.
Save textgoeshere/582266 to your computer and use it in GitHub Desktop.
>> node = Chef::Node.load(FQDN); nil
I, [2010-09-16T13:03:45.043798 #6792] INFO -- : CONNECT: [SERVER, 4000]
I, [2010-09-16T13:03:45.044017 #6792] INFO -- : GET /nodes/FQDN
I, [2010-09-16T13:03:48.330086 #6792] INFO -- : BODY: Net::HTTPOK
=> nil
>> x = node.lsb
=> #<Chef::Node::Attribute @auto_vivifiy_on_read=false, @automatic={...}, @default={...}, @current_normal=nil, @has_been_read=false, @current_automatic={"codename"=>"lucid", "id"=>"Ubuntu", "description"=>""Ubuntu 10.04.1 LTS"", "release"=>"10.04"}, normal{....}, set_typenil, state[:lsb], current_overridenil, set_unless_value_presentfalse, override{....}, current_defaultnil
>> x.codename
=> "lucid"
>> x.codename
ArgumentError: You tried to set a nested key, where the parent is not a hash-like object: lsb/codename/codename
from /home/dave/.gem/ruby/1.8/gems/chef-0.9.8/lib/chef/node/attribute.rb:375:in `auto_vivifiy'
from /home/dave/.gem/ruby/1.8/gems/chef-0.9.8/lib/chef/node/attribute.rb:285:in `get_value'
from /home/dave/.gem/ruby/1.8/gems/chef-0.9.8/lib/chef/node/attribute.rb:274:in `upto'
from /home/dave/.gem/ruby/1.8/gems/chef-0.9.8/lib/chef/node/attribute.rb:274:in `get_value'
from /home/dave/.gem/ruby/1.8/gems/chef-0.9.8/lib/chef/node/attribute.rb:118:in `attribute?'
from /home/dave/.gem/ruby/1.8/gems/chef-0.9.8/lib/chef/node/attribute.rb:409:in `method_missing'
from (irb):78
from :0
>> x["codename"]
=> "lucid"
>> x["codename"]
=> "lucid"
>> y = node.deployment
=> #<Chef::Node::Attribute @auto_vivifiy_on_read=false, @automatic={...}, @default={...}, @current_normal={"apps"=>{"statements"=>{"production"=>{}}}}, has_been_readfalse, current_automaticnil, normal{....}, set_typenil, state[:deployment], current_overridenil, set_unless_value_presentfalse, override{....}, current_defaultnil
>> y.apps
=> #<Chef::Node::Attribute @auto_vivifiy_on_read=false, @automatic={...}, @default={...}, @current_normal={"statements"=>{"production"=>{}}}, has_been_readfalse, current_automatic{}, normal{....}, set_typenil, state[:deployment, :apps], current_override{}, set_unless_value_presentfalse, override{....}, current_default{}
>> y.apps
ArgumentError: Attribute apps is not defined!
from /home/dave/.gem/ruby/1.8/gems/chef-0.9.8/lib/chef/node/attribute.rb:417:in `method_missing'
from (irb):83
from :0
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment