vagrant-nfs_guest 0.1.8 → 0.1.9

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: 198e6a741e26343a7ac6474db914d04870c245f0
4
- data.tar.gz: db2f73ebbeaf1aee9410ca613734e37a63141d7b
3
+ metadata.gz: eacf9d0633d8e0afd331d14d080dc251b5d425e8
4
+ data.tar.gz: 59e695490518b3c97c3e2c9be1a6dcc1ad27a2b2
5
5
  SHA512:
6
- metadata.gz: 57a3c7615a07b2cae4833833ab61e5b3b7d9687657a52a691a10f9041c4874aea2ba6a1f92d47ed63f35236247dac54778a8fe1b2ce748fa287b9215640baefb
7
- data.tar.gz: 45b6b20dcfa3f26dd6a9a46a5a51cf23ca2bda38eb3f75eb6cfe9518e6bb8f02d6f44e88996c38fcf49e0240b944b2c915254617595a38ce147e289de36eee75
6
+ metadata.gz: 75b2f3a1163f71f6f72720b2033f4455c7caedbc943a933ab97e999a22ef60ee9768a37038b9ec8eddd8ae255719ea2c5423c58349611ffd10e076cba23f45c0
7
+ data.tar.gz: 5a468411da16a54b95296e9070a5e732d53e5c8d262e8d9031284df9614964f5ff1e558ce6692ced1dee74a194a5b7f7762ebc64ff943e2a8cdb2792d9d11d9c
data/README.md CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  ## What's New?
4
4
 
5
- - NEW: added untested support for Parallels and Docker providers (Please raise any issues if they don't work!).
5
+ - NEW: added untested support for Docker providers (Please raise any issues if they don't work!).
6
+ - NEW: added Parallels provider support
6
7
  - NEW: Redhat/CentOS guest support added.
7
8
  - FIXED: suspend and resume with 'up' instead of 'resume' fixed.
8
9
  - Supports Vagrant > 1.6.
@@ -14,13 +14,14 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
14
14
  # Create a private network, which allows host-only access to the machine
15
15
  # using a specific IP.
16
16
  config.vm.network "private_network", ip: "192.168.55.10"
17
+ #config.vm.network "public_network"
17
18
 
18
19
  # Share an additional folder to the guest VM. The first argument is
19
20
  # the path on the host to the actual folder. The second argument is
20
21
  # the path on the guest to mount the folder. And the optional third
21
22
  # argument is a set of non-required options.
22
23
  config.vm.synced_folder '.', '/vagrant', disabled: true
23
-
24
24
  config.vm.synced_folder './vagrant_share', '/vagrant', type: 'nfs_guest'
25
+ #config.vm.synced_folder './vagrant_share', '/vagrant', type: 'nfs'
25
26
 
26
27
  end
@@ -36,6 +36,19 @@ module VagrantPlugins
36
36
  raise SyncedFolderNFSGuest::Errors::ProviderNFSSettingsCapMissing
37
37
  end
38
38
 
39
+ # grab the folders to check if any use nfs_guest and require host networking
40
+ folders = @machine.config.vm.synced_folders
41
+ nfs_guest = false
42
+ folders.each do |name, opts|
43
+ if opts[:type] == :nfs_guest
44
+ nfs_guest = true
45
+ end
46
+ end
47
+
48
+ if not nfs_guest
49
+ return
50
+ end
51
+
39
52
  # grab the ips from the provider
40
53
  host_ip, machine_ip = @machine.provider.capability(:nfs_settings)
41
54
 
@@ -50,8 +63,6 @@ module VagrantPlugins
50
63
  if installed
51
64
  # Mount guest NFS folders
52
65
  @machine.ui.info(I18n.t("vagrant_nfs_guest.actions.vm.nfs.mounting"))
53
- folders = @machine.config.vm.synced_folders
54
-
55
66
  @machine.env.host.capability(:nfs_mount, @machine.ui, @machine.id, machine_ip, folders)
56
67
  end
57
68
  end
@@ -15,8 +15,11 @@ module VagrantPlugins
15
15
  guestpath: opts[:guestpath],
16
16
  hostpath: opts[:hostpath]))
17
17
 
18
+ mount_options = opts.fetch(:mount_options, ["noatime"])
19
+ nfs_options = mount_options.empty? ? "" : "-o #{mount_options.join(',')}"
20
+
18
21
  system("mkdir -p #{opts[:hostpath]}")
19
- mount_command = "mount -t nfs -o noatime '#{ip}:#{opts[:guestpath]}' '#{opts[:hostpath]}'"
22
+ mount_command = "mount -t nfs #{nfs_options} '#{ip}:#{opts[:guestpath]}' '#{opts[:hostpath]}'"
20
23
  if system(mount_command)
21
24
  break
22
25
  end
@@ -14,8 +14,10 @@ module VagrantPlugins
14
14
  guestpath: opts[:guestpath],
15
15
  hostpath: opts[:hostpath]))
16
16
 
17
+ unmount_options = opts.fetch(:unmount_options, []).join(" ")
18
+
17
19
  expanded_host_path = `printf #{opts[:hostpath]}`
18
- umount_msg = `umount '#{expanded_host_path}' 2>&1`
20
+ umount_msg = `umount #{unmount_options} '#{expanded_host_path}' 2>&1`
19
21
 
20
22
  if $?.exitstatus != 0
21
23
  if not umount_msg.include? 'not currently mounted'
@@ -15,8 +15,11 @@ module VagrantPlugins
15
15
  guestpath: opts[:guestpath],
16
16
  hostpath: opts[:hostpath]))
17
17
 
18
+ mount_options = opts.fetch(:mount_options, ["noatime"])
19
+ nfs_options = mount_options.empty? ? "" : "-o #{mount_options.join(',')}"
20
+
18
21
  system("mkdir -p #{opts[:hostpath]}")
19
- mount_command = "sudo mount -t nfs -o noatime '#{ip}:#{opts[:guestpath]}' '#{opts[:hostpath]}'"
22
+ mount_command = "sudo mount -t nfs #{nfs_options} '#{ip}:#{opts[:guestpath]}' '#{opts[:hostpath]}'"
20
23
  if system(mount_command)
21
24
  break
22
25
  end
@@ -14,8 +14,10 @@ module VagrantPlugins
14
14
  guestpath: opts[:guestpath],
15
15
  hostpath: opts[:hostpath]))
16
16
 
17
+ unmount_options = opts.fetch(:unmount_options, []).join(" ")
18
+
17
19
  expanded_host_path = `printf #{opts[:hostpath]}`
18
- umount_msg = `sudo umount '#{expanded_host_path}' 2>&1`
20
+ umount_msg = `sudo umount #{unmount_options} '#{expanded_host_path}' 2>&1`
19
21
 
20
22
  if $?.exitstatus != 0
21
23
  if not umount_msg.include? 'not currently mounted'
@@ -1,14 +1,14 @@
1
+ require "vagrant/util/retryable"
2
+
1
3
  module VagrantPlugins
2
4
  module SyncedFolderNFSGuest
3
5
  module ProviderVirtualBox
4
6
  module Cap
7
+ extend Vagrant::Util::Retryable
5
8
 
6
9
  def self.nfs_settings(machine)
7
10
  adapter, host_ip = self.find_host_only_adapter(machine)
8
11
  machine_ip = self.read_static_machine_ips(machine) || self.read_dynamic_machine_ip(machine, adapter)
9
-
10
- raise Vagrant::Errors::NFSNoHostonlyNetwork if !host_ip || !machine_ip
11
-
12
12
  return host_ip, machine_ip
13
13
  end
14
14
 
@@ -77,7 +77,7 @@ module VagrantPlugins
77
77
  end
78
78
 
79
79
  # Separating these out so we can stub out the sleep in tests
80
- def retry_options
80
+ def self.retry_options
81
81
  {tries: 15, sleep: 1}
82
82
  end
83
83
  end
@@ -34,8 +34,7 @@ module VagrantPlugins
34
34
  host_ip, machine_ip = machine.provider.capability(:nfs_settings)
35
35
  machine_ip = [machine_ip] if !machine_ip.is_a?(Array)
36
36
 
37
- raise Vagrant::Errors::NFSNoHostIP if !host_ip
38
- raise Vagrant::Errors::NFSNoGuestIP if !machine_ip
37
+ raise Vagrant::Errors::NFSNoHostonlyNetwork if !host_ip || !machine_ip
39
38
 
40
39
  if machine.config.nfs_guest.verify_installed
41
40
  if machine.guest.capability?(:nfs_server_installed)
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module SyncedFolderNFSGuest
3
- VERSION = "0.1.8"
3
+ VERSION = "0.1.9"
4
4
  end
5
5
  end
@@ -41,6 +41,16 @@ en:
41
41
  Stdout from the command:
42
42
  %{stdout}
43
43
 
44
+ Stderr from the command:
45
+ %{stderr}
46
+ nfs_create_mounts_failed: |-
47
+ Something failed while creating the NFS mounts on the guest.
48
+
49
+ %{command}
50
+
51
+ Stdout from the command:
52
+ %{stdout}
53
+
44
54
  Stderr from the command:
45
55
  %{stderr}
46
56
 
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.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alan Garfield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-21 00:00:00.000000000 Z
11
+ date: 2016-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler