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) error_key(:nfs_no_valid_ids)
end end
class NFSNotSupported < VagrantError
error_key(:nfs_not_supported)
end
class NFSClientNotInstalledInGuest < VagrantError class NFSClientNotInstalledInGuest < VagrantError
error_key(:nfs_client_not_installed_in_guest) error_key(:nfs_client_not_installed_in_guest)
end end

View File

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

View File

@ -813,6 +813,12 @@ en:
No valid IDs were given to the NFS synced folder implementation to 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 prune. This is an internal bug with Vagrant and an issue should be
filed. 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: |- nfs_client_not_installed_in_guest: |-
No NFS client was detected as installed in your guest machine. This 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 is required for NFS synced folders to work. In addition to this, Vagrant