On Friday, February 8, 2013 at 3:38 AM, wrote:
Hello.I'm trying get node attribute from environment :<code>if node[:platform] == "ubuntu"default_attributes "troll" => "70lvl"end</code>but error pops up, then i'm uploading environment file to chef-server:<code>$ knife environment from file dev.rbERROR: knife encountered an unexpected errorThis may be a bug in the 'environment from file' knife command or pluginPlease collect the output of this command with the `-VV` option before filing abug report.Exception: NameError: undefined local variable or method `node' for#<Chef::Environment:0x7f1e8d08f270>$ knife environment from file dev.rb -VVDEBUG: Using configuration from /home/sabadash/.chef/knife.rb/home/sabadash/chef-repo/environments/dev.rb:12:in `from_file': undefined localvariable or method `node' for #<Chef::Environment:0x7fd7499b4b50> (NameError)from/usr/lib/ruby/gems/1.8/gems/chef-10.16.2/lib/chef/knife/core/object_loader.rb:96:in`object_from_file'from/usr/lib/ruby/gems/1.8/gems/chef-10.16.2/lib/chef/knife/core/object_loader.rb:42:in`load_from'from/usr/lib/ruby/gems/1.8/gems/chef-10.16.2/lib/chef/knife/environment_from_file.rb:59:in`load_environment'from/usr/lib/ruby/gems/1.8/gems/chef-10.16.2/lib/chef/knife/environment_from_file.rb:77:in`run'from/usr/lib/ruby/gems/1.8/gems/chef-10.16.2/lib/chef/knife/environment_from_file.rb:76:in`each'from/usr/lib/ruby/gems/1.8/gems/chef-10.16.2/lib/chef/knife/environment_from_file.rb:76:in`run'from /usr/lib/ruby/gems/1.8/gems/chef-10.16.2/lib/chef/knife.rb:408:in`run_with_pretty_exceptions'from /usr/lib/ruby/gems/1.8/gems/chef-10.16.2/lib/chef/knife.rb:168:in`run'from/usr/lib/ruby/gems/1.8/gems/chef-10.16.2/lib/chef/application/knife.rb:123:in`run'from /usr/lib/ruby/gems/1.8/gems/chef-10.16.2/bin/knife:25from /usr/bin/knife:19:in `load'from /usr/bin/knife:19</code>Can you please explain to me why is this happening? Is it possible to get nodeattributes from environment?
Archive powered by MHonArc 2.6.16.