vagrant-newdisk 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vagrant/newdisk/actions.rb +12 -6
- data/lib/vagrant/newdisk/config.rb +2 -7
- data/lib/vagrant/newdisk/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24db431da64a7b49c2c21da44bb3916496e3385e
|
4
|
+
data.tar.gz: 473fa5eccd34118fb13127d7de09fc7d6b9ae335
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 285c8e252c4a01dfe25d739f4c51d7d21763d4aeaedb8e06f8d7c421a33b570a95c8fcc39d807f823c374f9e1a1d9104ada53a4acb2440d0ab4b05b6ad623b92
|
7
|
+
data.tar.gz: 1625c7941861abafb8b09cc8491fb208487d10192d0c9e110bd46b230f912129d713836391fd36d19990f985a1ee5171f9e2c92f7e8c82fc079f9b571e5ec9f4
|
@@ -6,6 +6,7 @@ module Vagrant
|
|
6
6
|
def initialize(app, env)
|
7
7
|
@app = app
|
8
8
|
@machine = env[:machine]
|
9
|
+
@config = @machine.config.newdisk
|
9
10
|
@enabled = true
|
10
11
|
@ui = env[:ui]
|
11
12
|
if @machine.provider.to_s !~ /VirtualBox/
|
@@ -16,12 +17,17 @@ module Vagrant
|
|
16
17
|
|
17
18
|
def call(env)
|
18
19
|
# Create the disk before boot
|
19
|
-
if @enabled
|
20
|
-
|
21
|
-
|
22
|
-
env[:ui].info "
|
23
|
-
|
24
|
-
|
20
|
+
if @enabled and @config.is_set?
|
21
|
+
path = @config.path
|
22
|
+
size = @config.size
|
23
|
+
env[:ui].info "call newdisk: size = #{size}, path = #{path}"
|
24
|
+
|
25
|
+
if File.exist? path
|
26
|
+
env[:ui].info "skip newdisk - already exists: #{path}"
|
27
|
+
else
|
28
|
+
new_disk(env, path, size)
|
29
|
+
env[:ui].success "done newdisk: size = #{size}, path = #{path}"
|
30
|
+
end
|
25
31
|
end
|
26
32
|
|
27
33
|
# Allow middleware chain to continue so VM is booted
|
@@ -9,13 +9,8 @@ module Vagrant
|
|
9
9
|
@path = UNSET_VALUE
|
10
10
|
end
|
11
11
|
|
12
|
-
def
|
13
|
-
|
14
|
-
end
|
15
|
-
|
16
|
-
def validate(machine)
|
17
|
-
errors = []
|
18
|
-
return { 'Newdisk configuration' => errors }
|
12
|
+
def is_set?
|
13
|
+
@size != UNSET_VALUE and @path != UNSET_VALUE
|
19
14
|
end
|
20
15
|
end
|
21
16
|
end
|