vagrant-newdisk 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6e6dc15fece47b2c2b659960109e4fc37fb31299
4
- data.tar.gz: c201c5df7066de9a64065999ebff5174cf8d75d0
3
+ metadata.gz: fbc682c842f72a814d445e2a1c28471568de57df
4
+ data.tar.gz: eae0460ddc98349171be573b54a0fb0f729060b2
5
5
  SHA512:
6
- metadata.gz: 0a3c564a7bf83b3b775415fefedb04fb1e3eb70a50bc53848325dffc9759b2215770be54b936c3733d812a29cd26a70982a5a08c12861689605cc59dfb1ab1bd
7
- data.tar.gz: 695058b2614bc0a42efebe6ebef9db3d4102522dd663188fe6fe013046ef99215a72c1bcc06de48d9475bfb70ad59825de702cf6cd2fae6c9b8691f78d5ace81
6
+ metadata.gz: 488e58928d2ba91758f3dfa425362c946cdfdc57472a0907be23bf519c5625c3812ea47f3bbcf8ad730ba880d4146b8b4e8460a6b5e4b2248327bdc2370355b1
7
+ data.tar.gz: 3a28617cf0af81ae8bfead6a2d83ffd287426f895402313f8c4313f9315a6cba69251a2e6b22d8ba22aab9323e2cca384997d96e528a6a9a74e1cc75bd7edfcb
@@ -19,9 +19,9 @@ module Vagrant
19
19
  if @enabled
20
20
  size = @machine.config.newdisk.size
21
21
  path = @machine.config.newdisk.path
22
- env[:ui].error("size = #{size}")
23
- env[:ui].error("path = #{path}")
22
+ env[:ui].info "start newdisk: size = #{size}, path = #{path}"
24
23
  new_disk(env, path, size)
24
+ env[:ui].success "done newdisk: size = #{size}, path = #{path}"
25
25
  end
26
26
 
27
27
  # Allow middleware chain to continue so VM is booted
@@ -38,6 +38,7 @@ module Vagrant
38
38
 
39
39
  def attach_disk(driver, path)
40
40
  disk = find_place_for_new_disk(driver)
41
+ @ui.info "Attaching new disk: #{path} at #{disk}"
41
42
  driver.execute('storageattach', @machine.id, '--storagectl', disk[:controller],
42
43
  '--port', disk[:port].to_s, '--device', disk[:device].to_s, '--type', 'hdd',
43
44
  '--medium', path)
@@ -45,17 +46,14 @@ module Vagrant
45
46
 
46
47
  def find_place_for_new_disk(driver)
47
48
  disks = get_disks(driver)
48
- @ui.error "disks = #{disks.to_s}"
49
+ @ui.info "existing disks = #{disks.to_s}"
49
50
  controller = disks.first[:controller]
50
51
  disks = disks.select { |disk| disk[:controller] == controller }
51
52
  port = disks.map { |disk| disk[:port] }.max
52
53
  disks = disks.select { |disk| disk[:port] == port }
53
54
  max_device = disks.map { |disk| disk[:device] }.max
54
55
 
55
- @ui.error "last disks: #{disks.to_s}"
56
- new_disk = {:controller => controller, :port => port.to_i, :device => max_device.to_i + 1}
57
- @ui.error "new disk: #{new_disk.to_s}"
58
- new_disk
56
+ {:controller => controller, :port => port.to_i, :device => max_device.to_i + 1}
59
57
  end
60
58
 
61
59
  def get_disks(driver)
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  module Newdisk
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-newdisk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yavor Nikolov
@@ -51,8 +51,6 @@ files:
51
51
  - README.md
52
52
  - Rakefile
53
53
  - Vagrantfile
54
- - bin/console
55
- - bin/setup
56
54
  - lib/vagrant/newdisk.rb
57
55
  - lib/vagrant/newdisk/actions.rb
58
56
  - lib/vagrant/newdisk/config.rb
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "vagrant/newdisk"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here