[chef] Re: Re: Re: Re: Re: how to log-in to chef-server and create role normally?


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Cc:
  • Subject: [chef] Re: Re: Re: Re: Re: how to log-in to chef-server and create role normally?
  • Date: Wed, 7 Dec 2011 09:01:13 -0800



On Wednesday, December 7, 2011 at 4:05 AM, Ilya Maltsev wrote:

> Spice log on POST query:
> 
> --- &id001 !str 
> str: "{\"error\":[\"undefined method `name' for nil:NilClass\"]}"

Looks like you're missing quite a few fields in the JSON you post to the 
server. I'd consider it a bug that this doesn't return a 400 with a 
description of which fields are missing.

Anyway, you can play with this stuff in `shef`:

chef > new_role = Chef::Role.new
=> role[] 
chef > new_role.name("my-new-role")
=> "my-new-role" 
chef > new_role.to_json
=> 
"{\"name\":\"my-new-role\",\"description\":\"\",\"json_class\":\"Chef::Role\",\"default_attributes\":{},\"override_attributes\":{},\"chef_type\":\"role\",\"run_list\":[],\"env_run_lists\":{}}"
 




-- 
Dan DeLeo




Archive powered by MHonArc 2.6.16.

§