vagrant-nfs_guest 0.1.10 → 0.1.11

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: 0771013396d848986039995c6c141fb2f708e055
4
- data.tar.gz: cb811ecd4363e1f53aa3345e801afc4c9996c867
3
+ metadata.gz: 68bea2f019bd5edd93dc71b5f11914463aef8e82
4
+ data.tar.gz: d1624a4519e1b43607df404a6f10961142941d1b
5
5
  SHA512:
6
- metadata.gz: 8b009e04c677b333c8ca24203e7f1b0685b59131414428b0fcb652cc0383a89271cd6f6c54f950dac1ca302461bcf59f304650ea83731a906e942d1a12a59d5d
7
- data.tar.gz: 61f4ea0c2300fcbdbe065bd1c31e5079c5380c5ffa19bf07d97a5f755b04ceca7fdb9921bdd233f55c3701a589ae34e2269c977c0e1c74ac0ee1b290b44264cd
6
+ metadata.gz: 18d17c27a60291cb93c48ba1f7732d9aa9bb25746ec1aaf21003df1ba7ca2f65739f54ce76d0b7b29ae9064556f42e4f7f0c551f5bf31f30da0a9409a9327875
7
+ data.tar.gz: 584169bcaaf4ec740a3731b0e7aee83c1933c0dc03f45a38f199fb81648e4976cd865a9debacce1a8d3429c89be30779f6998cc4781dd4a39d6a314acf1979f3
data/README.md CHANGED
@@ -5,6 +5,7 @@
5
5
  - NEW: added untested support for Docker providers (Please raise any issues if they don't work!).
6
6
  - NEW: added Parallels provider support
7
7
  - NEW: Redhat/CentOS guest support added.
8
+ - NEW: Now properly handles force halts
8
9
  - FIXED: suspend and resume with 'up' instead of 'resume' fixed.
9
10
  - Supports Vagrant > 1.6.
10
11
  - Handles actions ```up```, ```halt```, ```destroy```, ```suspend```, ```resume``` and ```package``` properly.
@@ -28,8 +29,9 @@ Guest VMs we've tested include:
28
29
  - other Linux based guests may work fine with the generic Linux support. But no guarantee
29
30
 
30
31
  Hosts we've tested include:
31
- - OSX (Mavericks, Yosemite, El Capitan)
32
+ - OSX (Mavericks, Yosemite, El Capitan, Siera)
32
33
  - Ubuntu (precise, trusty)
34
+ - CentOS (6, 7)
33
35
  - other Linux based OSs should work fine, but will need testing, again no guarantee
34
36
 
35
37
  We're happy to receive pull-request to support alternatives hosts and guests. To implement this support it's relatively trivial if you look in ./lib/hosts and ./lib/guests.
@@ -21,7 +21,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
21
21
  # the path on the guest to mount the folder. And the optional third
22
22
  # argument is a set of non-required options.
23
23
  config.vm.synced_folder '.', '/vagrant', disabled: true
24
- config.vm.synced_folder './vagrant_share', '/vagrant', type: 'nfs_guest'
24
+ config.vm.synced_folder './vagrant_share', '/vagrant', create: true, type: 'nfs_guest'
25
25
  #config.vm.synced_folder './vagrant_share', '/vagrant', type: 'nfs'
26
26
 
27
27
  end
@@ -42,6 +42,7 @@ module VagrantPlugins
42
42
  folders.each do |name, opts|
43
43
  if opts[:type] == :nfs_guest
44
44
  nfs_guest = true
45
+ opts[:hostpath] = File.expand_path(opts[:hostpath], env[:root_path])
45
46
  end
46
47
  end
47
48
 
@@ -16,6 +16,20 @@ module VagrantPlugins
16
16
  @machine.ui.info(I18n.t("vagrant_nfs_guest.actions.vm.nfs.unmounting"))
17
17
  folders = @machine.config.vm.synced_folders
18
18
 
19
+ folders.each do |name, opts|
20
+ if opts[:type] == :nfs_guest
21
+ opts[:hostpath] = File.expand_path(opts[:hostpath], env[:root_path])
22
+ if env[:force_halt]
23
+ # If this is a force halt, force unmount the nfs shares.
24
+ opts[:unmount_options] = opts.fetch(:unmount_options, []) << '-f'
25
+ # We have to change the working dir if inside a hostmount to prevent "No such file or directory - getcwd" errors.
26
+ if Dir.pwd.start_with?(opts[:hostpath])
27
+ Dir.chdir("#{opts[:hostpath]}/..")
28
+ end
29
+ end
30
+ end
31
+ end
32
+
19
33
  @machine.env.host.capability(:nfs_unmount, @machine.ui, folders)
20
34
  end
21
35
 
@@ -18,7 +18,6 @@ module VagrantPlugins
18
18
  mount_options = opts.fetch(:mount_options, ["noatime"])
19
19
  nfs_options = mount_options.empty? ? "" : "-o #{mount_options.join(',')}"
20
20
 
21
- system("mkdir -p #{opts[:hostpath]}")
22
21
  mount_command = "mount -t nfs #{nfs_options} '#{ip}:#{opts[:guestpath]}' '#{opts[:hostpath]}'"
23
22
  if system(mount_command)
24
23
  break
@@ -16,8 +16,7 @@ module VagrantPlugins
16
16
 
17
17
  unmount_options = opts.fetch(:unmount_options, []).join(" ")
18
18
 
19
- expanded_host_path = `printf #{opts[:hostpath]}`
20
- umount_msg = `umount #{unmount_options} '#{expanded_host_path}' 2>&1`
19
+ umount_msg = `umount #{unmount_options} '#{opts[:hostpath]}' 2>&1`
21
20
 
22
21
  if $?.exitstatus != 0
23
22
  if not umount_msg.include? 'not currently mounted'
@@ -18,7 +18,6 @@ module VagrantPlugins
18
18
  mount_options = opts.fetch(:mount_options, ["noatime"])
19
19
  nfs_options = mount_options.empty? ? "" : "-o #{mount_options.join(',')}"
20
20
 
21
- system("mkdir -p #{opts[:hostpath]}")
22
21
  mount_command = "sudo mount -t nfs #{nfs_options} '#{ip}:#{opts[:guestpath]}' '#{opts[:hostpath]}'"
23
22
  if system(mount_command)
24
23
  break
@@ -16,8 +16,7 @@ module VagrantPlugins
16
16
 
17
17
  unmount_options = opts.fetch(:unmount_options, []).join(" ")
18
18
 
19
- expanded_host_path = `printf #{opts[:hostpath]}`
20
- umount_msg = `sudo umount #{unmount_options} '#{expanded_host_path}' 2>&1`
19
+ umount_msg = `sudo umount #{unmount_options} '#{opts[:hostpath]}' 2>&1`
21
20
 
22
21
  if $?.exitstatus != 0
23
22
  if not umount_msg.include? 'not currently mounted'
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module SyncedFolderNFSGuest
3
- VERSION = "0.1.10"
3
+ VERSION = "0.1.11"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-nfs_guest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alan Garfield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-19 00:00:00.000000000 Z
11
+ date: 2017-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,7 +52,6 @@ files:
52
52
  - README.md
53
53
  - Rakefile
54
54
  - example_box/Vagrantfile
55
- - example_box/vagrant_share/.keep
56
55
  - lib/vagrant-nfs_guest.rb
57
56
  - lib/vagrant-nfs_guest/action/mount_nfs.rb
58
57
  - lib/vagrant-nfs_guest/action/unmount_nfs.rb
File without changes