Check usability of nfs on host

This commit is contained in:
Brian Pitts 2014-05-03 16:09:08 -05:00
parent 51ffa4181c
commit 4d90fdfec5
3 changed files with 13 additions and 8 deletions

View File

@ -460,6 +460,10 @@ module Vagrant
error_key(:nfs_no_valid_ids)
end
class NFSNotSupported < VagrantError
error_key(:nfs_not_supported)
end
class NFSClientNotInstalledInGuest < VagrantError
error_key(:nfs_client_not_installed_in_guest)
end

View File

@ -30,14 +30,9 @@ module VagrantPlugins
if !machine.config.nfs.functional
return false
end
# We don't currently support NFS on Windows
if Vagrant::Util::Platform.windows?
return false
end
# NFS is always available
true
return true if machine.env.host.capability(:nfs_installed)
return false if !raise_error
raise Vagrant::Errors::NFSNotSupported
end
def prepare(machine, folders, opts)

View File

@ -813,6 +813,12 @@ en:
No valid IDs were given to the NFS synced folder implementation to
prune. This is an internal bug with Vagrant and an issue should be
filed.
nfs_not_supported: |-
It appears your machine doesn't support NFS, or there is not an
adapter to enable NFS on this machine for Vagrant. Please verify
that `nfsd` is installed on your machine, and try again. If you're
on Windows, NFS isn't supported. If the problem persists, please
contact Vagrant support.
nfs_client_not_installed_in_guest: |-
No NFS client was detected as installed in your guest machine. This
is required for NFS synced folders to work. In addition to this, Vagrant