vagrant-butcher 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -18,10 +18,6 @@ And then execute:
18
18
 
19
19
  $ bundle
20
20
 
21
- Or install it yourself as:
22
-
23
- $ gem install vagrant-butcher
24
-
25
21
  ### If you're not using bundler
26
22
 
27
23
  You have to install this plugin via Vagrant:
@@ -34,7 +30,7 @@ Explanation for that is found on the [Vagrant Plugins Documentation](http://vagr
34
30
 
35
31
  The plugin is loaded automatically once installed.
36
32
 
37
- By default, the gem looks for `$HOME/.chef/knife.rb` for the Chef server settings. This setting can be overrdidden by setting:
33
+ By default, the gem looks for the Chef server settings on `$HOME/.chef/knife.rb`. This can be overrdidden by setting:
38
34
 
39
35
  Vagrant::Config.run do |config|
40
36
  config.vm.provision :chef_solo do |chef|
@@ -7,13 +7,13 @@ module Vagrant
7
7
  end
8
8
 
9
9
  def cleanup_chef_server(host_name)
10
- env[:ui].info "Removing node and client \"#{host_name}\" from Chef server"
11
- [::Chef::Node, ::Chef::ApiClient].each do |chef_resource|
10
+ chef_api = ::Chef::REST.new(::Chef::Config[:chef_server_url])
11
+ %w(node client).each do |resource|
12
+ env[:ui].info "Removing Chef #{resource} \"#{host_name}\"..."
12
13
  begin
13
- chef_resource = chef_resource.load(host_name)
14
- chef_resource.destroy
14
+ chef_api.delete_rest("#{resource}s/#{host_name}")
15
15
  rescue Exception => e
16
- env[:ui].warn "Could not destroy #{chef_resource} #{host_name}: #{e.message}"
16
+ env[:ui].warn "Could not remove #{resource} #{host_name}: #{e.message}"
17
17
  end
18
18
  end
19
19
  end
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  module Butcher
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-butcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-17 00:00:00.000000000 Z
12
+ date: 2013-01-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: vagrant