vagrant-persistent-storage 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 67e6213d9ca791c31e2c7fed2c93621e787002a7
4
- data.tar.gz: b4cdb3519aacc50be8585cca8c2148bf547b79f1
3
+ metadata.gz: 759602c1db9e4c506b7ab8490677bef33d706298
4
+ data.tar.gz: 0d11cc889c70e69e32f8ba9804ca3925b9384552
5
5
  SHA512:
6
- metadata.gz: d940162663e3885e7cde935e0f561b50882cbf7a01bbd0593684e2526a6fb140c13f3acc310caeef1df441bdac4a6894f785a529b4891b15c896f01a1738fb52
7
- data.tar.gz: 2d3208fb62492f34e78eb69300d7c26ebf6a9d8fda5960dad96df2a4b176f5e8fa7fe692e1e79e6e77917a077f2a01d4dff4fbd991559a602dadbe2d85bfe701
6
+ metadata.gz: 690416da1c16126b504b705cce233be336ef72f2712ba15cf54b619019a507832a5cf0c66f0950cb26a16269299cc472dfd16d0cda4ff62b4a2d3fb3324573ec
7
+ data.tar.gz: c3deb57309441d4f6790d148a745a02c4fc4b459cbfbf05125e904afff5f44b34a666ef99152b5bd4016f0a3f008696d675f94164642ab4ed7c7a2fbd9a8636d
@@ -6,12 +6,12 @@ module VagrantPlugins
6
6
  class Base
7
7
 
8
8
  def create_adapter
9
- sata_controller_name = get_sata_controller_name
10
- if sata_controller_name.nil?
11
- sata_controller_name = "SATA Controller"
12
- execute("storagectl", @uuid, "--name", sata_controller_name, "--" + (@version.start_with?("4.3") ? "" : "sata") + "portcount", "2", "--add", "sata")
9
+ controller_name = get_controller_name
10
+ if controller_name.nil?
11
+ controller_name = "SATA Controller"
12
+ execute("storagectl", @uuid, "--name", controller_name, "--" + (@version.start_with?("4.3") ? "" : "sata") + "portcount", "2", "--add", "sata")
13
13
  else
14
- execute("storagectl", @uuid, "--name", sata_controller_name, "--" + (@version.start_with?("4.3") ? "" : "sata") + "portcount", "2")
14
+ execute("storagectl", @uuid, "--name", controller_name, "--" + (@version.start_with?("4.3") ? "" : "sata") + "portcount", "2")
15
15
  end
16
16
  end
17
17
 
@@ -20,13 +20,13 @@ module VagrantPlugins
20
20
  end
21
21
 
22
22
  def attach_storage(location)
23
- execute("storageattach", @uuid, "--storagectl", get_sata_controller_name, "--port", "1", "--device", "0", "--type", "hdd", "--medium", "#{location}")
23
+ execute("storageattach", @uuid, "--storagectl", get_controller_name, "--port", "1", "--device", "0", "--type", "hdd", "--medium", "#{location}")
24
24
  end
25
25
 
26
26
  def detach_storage(location)
27
27
  persistent_storage = read_persistent_storage()
28
28
  if location and persistent_storage != "none" and identical_files(persistent_storage, location)
29
- execute("storageattach", @uuid, "--storagectl", get_sata_controller_name, "--port", "1", "--device", "0", "--type", "hdd", "--medium", "none")
29
+ execute("storageattach", @uuid, "--storagectl", get_controller_name, "--port", "1", "--device", "0", "--type", "hdd", "--medium", "none")
30
30
  end
31
31
  end
32
32
 
@@ -35,7 +35,7 @@ module VagrantPlugins
35
35
  sleep 3
36
36
  info = execute("showvminfo", @uuid, "--machinereadable", :retryable => true)
37
37
  info.split("\n").each do |line|
38
- return $1.to_s if line =~ /^"#{get_sata_controller_name}-1-0"="(.+?)"$/
38
+ return $1.to_s if line =~ /^"#{get_controller_name}-1-0"="(.+?)"$/
39
39
  end
40
40
  nil
41
41
  end
@@ -44,15 +44,20 @@ module VagrantPlugins
44
44
  return File.identical?(Pathname.new(file1).realpath, Pathname.new(file2).realpath)
45
45
  end
46
46
 
47
- def get_sata_controller_name
47
+ def get_controller_name
48
+ controller_number = nil
48
49
  controllers = Hash.new
49
50
  info = execute("showvminfo", @uuid, "--machinereadable", :retryable => true)
50
51
  info.split("\n").each do |line|
51
52
  controllers[$1] = $2 if line =~ /^storagecontrollername(\d+)="(.*)"/
52
- sata_controller_number = $1 if line =~ /^storagecontrollertype(\d+)="IntelAhci"/
53
- return controllers[sata_controller_number] unless controllers[sata_controller_number].nil?
53
+ controller_number = $1 if line =~ /^storagecontrollertype(\d+)="(IntelAhci|PIIX4)"/
54
54
  end
55
- return nil
55
+
56
+ if controller_number.nil?
57
+ return nil
58
+ end
59
+
60
+ return controllers[controller_number]
56
61
  end
57
62
 
58
63
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module PersistentStorage
3
- VERSION = "0.0.12"
3
+ VERSION = "0.0.13"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-persistent-storage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Kusnier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-07 00:00:00.000000000 Z
11
+ date: 2014-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: A Vagrant plugin that creates a persistent storage and attaches it to
@@ -46,7 +46,7 @@ executables: []
46
46
  extensions: []
47
47
  extra_rdoc_files: []
48
48
  files:
49
- - .gitignore
49
+ - ".gitignore"
50
50
  - Gemfile
51
51
  - LICENSE
52
52
  - README.md
@@ -78,17 +78,17 @@ require_paths:
78
78
  - lib
79
79
  required_ruby_version: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - '>='
81
+ - - ">="
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - '>='
86
+ - - ">="
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  requirements: []
90
90
  rubyforge_project:
91
- rubygems_version: 2.0.3
91
+ rubygems_version: 2.0.14
92
92
  signing_key:
93
93
  specification_version: 4
94
94
  summary: A Vagrant plugin that creates a persistent storage and attaches it to guest