vagrant-persistent-storage 0.0.46 → 0.0.47

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: 4837fd59327b9bb86feed1bb7a3dd11189573365
4
- data.tar.gz: 41e3fd130655643213d059181493a245198d6f8b
3
+ metadata.gz: 0c1f7961084fd1bc13ea55f1000e5e94753e69fd
4
+ data.tar.gz: f3cd4a6cb46192aac0dfb5975a92c3839575f901
5
5
  SHA512:
6
- metadata.gz: 354207edfea91e109672e4059fdef1308e0897f70350868a6fc9c4f6d49ca5df799c618c6e18709e875937d1fc8a661670479532b07a8a5ce0d00dae382bcbdc
7
- data.tar.gz: e845f5e1ec53847b798fbe97568c26f44b104b77fddffb7441c78ba9e85db6cfcd289dd14273a7e01a3ae108cf8cfec68ed8b50cbd6f5f4c8ccc2b72cc5f447b
6
+ metadata.gz: b8b9b167cbf68baa93b6510af517ad753faa18efa921cac68b8c76ef820a63aa03d1b33fdf6df60bb97eb9dfd971b4b94e42ee9b51a3eb65314741f9e23cef85
7
+ data.tar.gz: 2beb8f63549e196163fd6e8293c462792e3e1b3fc76aff9c1c0c204709bc1efd9d699c9b0b151483ac1fa0d9d24257c747d4da6f7377516413eec861a8b633a9
@@ -48,6 +48,7 @@ module VagrantPlugins
48
48
  persistent_storage_data = read_persistent_storage(location_realpath)
49
49
  if location and persistent_storage_data and identical_files(persistent_storage_data.location, location_realpath)
50
50
  execute("storageattach", @uuid, "--storagectl", persistent_storage_data.controller, "--port", persistent_storage_data.port, "--device", "0", "--type", "hdd", "--medium", "none")
51
+ execute("closemedium", "disk", persistent_storage_data.image)
51
52
  end
52
53
  end
53
54
 
@@ -57,13 +58,27 @@ module VagrantPlugins
57
58
  storage_data = nil
58
59
  controller_name = get_controller_name
59
60
  info = execute("showvminfo", @uuid, "--machinereadable", :retryable => true)
61
+ # Parse the following two lines matching the controller name:
62
+ # "SATA Controller-4-0"="/data/my-persistent-disk.vdi"
63
+ # "SATA Controller-ImageUUID-4-0"="1b5c4a17-3f84-49ba-b394-bfc609f30283"
64
+ # The first reports the underlying file, while the second reports the
65
+ # UUID of the VirtualBox medium.
60
66
  info.split("\n").each do |line|
61
67
  tmp_storage_data = nil
62
- tmp_storage_data = PersistentStorageData.new(controller_name, $1, $3) if line =~ /^"#{controller_name}-(\d+)-(\d+)"="(.*)"/
68
+ tmp_storage_data = PersistentStorageData.new(controller_name, $1, $3, nil) if line =~ /^"#{controller_name}-(\d+)-(\d+)"="(.*)"/
69
+
70
+ tmp_storage_data_image = nil
71
+ tmp_storage_data_image = $3 if line =~ /^"#{controller_name}-ImageUUID-(\d+)-(\d+)"="(.*)"/
63
72
 
64
73
  if !tmp_storage_data.nil? and tmp_storage_data.location != 'none' and identical_files(File.expand_path(location), tmp_storage_data.location)
65
74
  storage_data = tmp_storage_data
66
75
  end
76
+
77
+ # XXX: The ImageUUID line comes second and thus we have already
78
+ # storage_data initialized.
79
+ if !storage_data.nil? and !tmp_storage_data_image.nil?
80
+ storage_data.image = tmp_storage_data_image
81
+ end
67
82
  end
68
83
  return storage_data
69
84
  end
@@ -93,11 +108,13 @@ module VagrantPlugins
93
108
  attr_accessor :controller
94
109
  attr_accessor :port
95
110
  attr_accessor :location
111
+ attr_accessor :image
96
112
 
97
- def initialize(controller,port,location)
113
+ def initialize(controller,port,location,image)
98
114
  @controller = controller
99
115
  @port = port
100
116
  @location = location
117
+ @image = image
101
118
  end
102
119
  end
103
120
 
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module PersistentStorage
3
- VERSION = "0.0.46"
3
+ VERSION = "0.0.47"
4
4
  end
5
5
  end
data/test.sh CHANGED
@@ -31,8 +31,8 @@ do
31
31
  else
32
32
  echo ...[FAILED]
33
33
  fi
34
- VAGRANT_VAGRANTFILE="$f" vagrant destroy -f --no-color >> $f.log && "$VBOXMANAGE" closemedium disk virtualdrive.vdi --delete >> $f.log 2>&1
34
+ VAGRANT_VAGRANTFILE="$f" vagrant destroy -f --no-color >> $f.log && rm -fv virtualdrive.vdi >> $f.log 2>&1
35
35
  done
36
36
 
37
37
 
38
- popd > /dev/null
38
+ popd > /dev/null
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-persistent-storage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.46
4
+ version: 0.0.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Kusnier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-21 00:00:00.000000000 Z
11
+ date: 2019-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake