vagrant-clean 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vagrant-clean/command.rb +14 -9
- data/lib/vagrant-clean/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 880fc13835d666428427ffbafe1a1e3ecc9dcdf4
|
4
|
+
data.tar.gz: c99db95121112caf06948b7a3e7f735d16be6267
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0911cd6624b65f835c737ca7467b6766091dea8f7e542bc7d1d4114e2a4d5812b9bdc474ac86576dae03c06f0db7e76a346d69e853aed881270d7e68ad92b181
|
7
|
+
data.tar.gz: 8c881db5ce463880d76b0ca06a8e46325cd98fb4f04d01fa610bf4aea24a71dddc7a2f4a8d3ff00a29231c700dce093c585f6bd06887d2f8dadcfa0465bb949f
|
@@ -14,26 +14,31 @@ module VagrantPlugins
|
|
14
14
|
prune = []
|
15
15
|
|
16
16
|
@env.machine_index.each do |entry|
|
17
|
-
|
17
|
+
begin
|
18
|
+
env = entry.vagrant_env(@env.home_path)
|
19
|
+
rescue Vagrant::Errors::EnvironmentNonExistentCWD
|
20
|
+
entry = @env.machine_index.get(entry.id)
|
21
|
+
@env.machine_index.delete(entry) if entry
|
22
|
+
next
|
23
|
+
end
|
18
24
|
machine = env.machine(entry.name.to_sym, entry.provider.to_sym)
|
19
|
-
@env.ui.info("Destroying
|
25
|
+
@env.ui.info("==> Destroying vm #{entry.name}:#{entry.id[0..6]}", bold: true)
|
20
26
|
action_env = machine.action(:destroy, force_confirm_destroy: true)
|
21
27
|
|
22
28
|
# Remove machine from index if it was destroyed
|
23
29
|
if action_env.key?(:force_confirm_destroy_result) && action_env[:force_confirm_destroy_result] == true
|
24
|
-
@env.ui.
|
30
|
+
@env.ui.success("==> Destroyed")
|
25
31
|
else
|
26
|
-
@env.ui.warn("
|
32
|
+
@env.ui.warn("==> Warning: failed to destroy #{entry.name}:#{entry.id[0..6]}")
|
27
33
|
end
|
28
34
|
|
29
|
-
prune << entry
|
35
|
+
prune << entry.id
|
30
36
|
end
|
31
37
|
|
32
38
|
# Must remove machine from the global index
|
33
|
-
prune.each do |
|
34
|
-
|
35
|
-
@env.machine_index.delete(
|
36
|
-
@env.machine_index.release(e)
|
39
|
+
prune.each do |id|
|
40
|
+
entry = @env.machine_index.get(id)
|
41
|
+
@env.machine_index.delete(entry) if entry
|
37
42
|
end
|
38
43
|
|
39
44
|
return 0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-clean
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Spaulding
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|