vagrant-persistent-storage 0.0.44 → 0.0.45
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 +4 -4
- data/README.md +1 -1
- data/lib/vagrant-persistent-storage/manage_storage.rb +10 -3
- data/lib/vagrant-persistent-storage/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: 5f9fcafa3789760470ab50be0e2e1333d521a7bc
|
4
|
+
data.tar.gz: bbd4c5cb47a8ebb2b2778db8a75f2431dc5305f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed3a10903752658495b0712338a3c344b020c2382a91e6c54a2827288301894949cc9c9810233131c7122b9ce3c73e8b45e0afc072f359d1f3af4a9c6bef2279
|
7
|
+
data.tar.gz: b4b491e64b4b129ffa2154ac0f06ea1a14f95729f8853bd92a5dcff59c215650019681a10eec739f82214e686ea001097e3d0848b2576a3e30025f54dbd70fd3
|
data/README.md
CHANGED
@@ -69,7 +69,7 @@ Options that are irrelevent to Windows are ignored, such as `mountname`, `filesy
|
|
69
69
|
|
70
70
|
## How Is The Storage Created?
|
71
71
|
|
72
|
-
Based on the configuration provided, during a `vagrant up` a bash script is generated and uploaded to
|
72
|
+
Based on the configuration provided, during a `vagrant up` a bash script is generated and uploaded to `$tmpdir/disk_operations_#{mnt_name}.sh` (Linux) or `disk_operations_#{mnt_name}.ps1` (Windows). If the box has not been previously provisioned the script is executed on a `vagrant up`. To force the script to be executed again you can run `vagrant provision` or if you have halted the box, `vagrant up --provision`.
|
73
73
|
|
74
74
|
The outcome of the script being run is placed in the home drive of the vagrant user in a file called `disk_operation_log.txt`.
|
75
75
|
|
@@ -5,6 +5,12 @@ require 'erb'
|
|
5
5
|
module VagrantPlugins
|
6
6
|
module PersistentStorage
|
7
7
|
module ManageStorage
|
8
|
+
def get_tmp_dir(m)
|
9
|
+
m.communicate.sudo('dirname $(mktemp -u)', :error_check => false) do |type, data|
|
10
|
+
tmpdir = data.to_s.strip
|
11
|
+
return tmpdir
|
12
|
+
end
|
13
|
+
end
|
8
14
|
def populate_template(m)
|
9
15
|
mnt_name = m.config.persistent_storage.mountname
|
10
16
|
mnt_point = m.config.persistent_storage.mountpoint
|
@@ -115,7 +121,8 @@ exit $?
|
|
115
121
|
if os == 'windows'
|
116
122
|
target_script = "disk_operations_#{mnt_name}.ps1"
|
117
123
|
else
|
118
|
-
|
124
|
+
tmpdir = get_tmp_dir(m)
|
125
|
+
target_script = tmpdir + "/disk_operations_#{mnt_name}.sh"
|
119
126
|
end
|
120
127
|
|
121
128
|
File.open("#{tmp_script.path}", 'wb') do |f|
|
@@ -135,7 +142,8 @@ exit $?
|
|
135
142
|
target_script = "disk_operations_#{mnt_name}.ps1"
|
136
143
|
m.communicate.sudo("powershell -executionpolicy bypass -file #{target_script}")
|
137
144
|
else
|
138
|
-
|
145
|
+
tmpdir = get_tmp_dir(m)
|
146
|
+
target_script = tmpdir + "/disk_operations_#{mnt_name}.sh"
|
139
147
|
m.communicate.sudo("#{target_script}")
|
140
148
|
end
|
141
149
|
|
@@ -147,7 +155,6 @@ exit $?
|
|
147
155
|
run_disk_operations(m)
|
148
156
|
end
|
149
157
|
end
|
150
|
-
|
151
158
|
end
|
152
159
|
end
|
153
160
|
end
|
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.
|
4
|
+
version: 0.0.45
|
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-
|
11
|
+
date: 2019-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|