[chef] Help with vagrant-butcher and the Chef API

Chronological Thread 
  • From: Cassiano Leal < >
  • To:
  • Subject: [chef] Help with vagrant-butcher and the Chef API
  • Date: Wed, 26 Dec 2012 16:41:39 -0200

Ohai Chefs,

I'm struggling to get vagrant-butcher [0] to work in my current setup. I'm not sure what has changed since last time, but it used to work just fine. (And I know that this last sentence isn't very helpful, but it's what I've got :)

I'm using the methods Chef::Node.load and Chef::ApiClient.load, with a subsequent destroy on the object [1].

Digging into the Chef source code, I found out that I can call Chef::Node.build [2] and then destroy, and it works fine.

The same cannot be said about ApiClient, which doesn't have a build method. For that, load should work, except it doesn't. The problem seems to be that it's trying to reference the client by a key 'clientname' [3], whereas I get a hash with a 'name' key instead [4].

Any clues as to what I'm doing wrong here, or if I should file bugs for Chef?

Also, if anyone had any success or failures in using the gem, I'd like to know as much as possible so that I can pinpoint where the issue might lie as well.


[0] https://github.com/cassianoleal/vagrant-butcher
[1] https://github.com/cassianoleal/vagrant-butcher/blob/master/lib/vagrant-butcher/cleanup.rb#L13-L14
[2] https://github.com/opscode/chef/blob/10.16.4/chef/lib/chef/node.rb#L595-L600
[3] https://github.com/opscode/chef/blob/10.16.4/chef/lib/chef/api_client.rb#L211
[4] https://gist.github.com/4381943

Cassiano Leal

Archive powered by MHonArc 2.6.16.