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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0c150ceb7eaff53a28ae1acf561970b5a35ec75
4
- data.tar.gz: 111e5f2f5ef40a711a31f8d40d93d349d7eaa9c4
3
+ metadata.gz: 5f9fcafa3789760470ab50be0e2e1333d521a7bc
4
+ data.tar.gz: bbd4c5cb47a8ebb2b2778db8a75f2431dc5305f1
5
5
  SHA512:
6
- metadata.gz: 52fd811411ae2e8b0b23949c1f2b8ffe2c572ba7ab2575ffb3cb95d0f945250ac24eed14f3de5ea4d3c6c6b8806239f763eb99d2a1b109b1436aaa1e495a7ea1
7
- data.tar.gz: eea95b5979d7a0f8453c985400b6de4a06dc7cc544476b5deb6d1f465fd17f142b33bf7354abfb31bcc8cb52376a4bd587009b6dd296f4ef689d59a7f68ffcf6
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 `/tmp/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`.
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
- target_script = "/tmp/disk_operations_#{mnt_name}.sh"
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
- target_script = "/tmp/disk_operations_#{mnt_name}.sh"
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
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module PersistentStorage
3
- VERSION = "0.0.44"
3
+ VERSION = "0.0.45"
4
4
  end
5
5
  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.44
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-02-22 00:00:00.000000000 Z
11
+ date: 2019-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake