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


Chronological Thread 
  • From: Ilya Maltsev < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Re: Re: how to log-in to chef-server and create role normally?
  • Date: Thu, 08 Dec 2011 10:36:38 +0400

Hello! Thank you.
And how to send this json? we don't understand, sorry.

On Срд, 2011-12-07 at 09:01 -0800, Daniel DeLeo wrote:

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\":{}}" 





-- 
Best regards,
Ilya Maltsev



Archive powered by MHonArc 2.6.16.

§