Raise error if no hostonly network on VBox with NFS [GH-1437]

This commit is contained in:
Mitchell Hashimoto 2013-03-17 22:33:02 -07:00
parent 9e80a55d7b
commit 022c1daec0
4 changed files with 12 additions and 0 deletions

View File

@ -25,6 +25,8 @@ BUG FIXES:
- Fix minor issues with defaults of configuration of the shell - Fix minor issues with defaults of configuration of the shell
provisioner. provisioner.
- Fix Puppet server using "host_name" instead of "hostname" [GH-1444] - Fix Puppet server using "host_name" instead of "hostname" [GH-1444]
- Raise a proper error if no hostonly network is found for NFS with
VirtualBox. [GH-1437]
## 1.1.0 (March 14, 2013) ## 1.1.0 (March 14, 2013)

View File

@ -267,6 +267,10 @@ module Vagrant
error_key(:nfs_no_host_ip) error_key(:nfs_no_host_ip)
end end
class NFSNoHostonlyNetwork < VagrantError
error_key(:nfs_no_hostonly_network)
end
class NoEnvironmentError < VagrantError class NoEnvironmentError < VagrantError
error_key(:no_env) error_key(:no_env)
end end

View File

@ -12,6 +12,8 @@ module VagrantPlugins
env[:nfs_host_ip] = read_host_ip(env[:machine]) env[:nfs_host_ip] = read_host_ip(env[:machine])
env[:nfs_machine_ip] = read_machine_ip(env[:machine]) env[:nfs_machine_ip] = read_machine_ip(env[:machine])
raise Errors::NFSNoHostonlyNetwork if !env[:nfs_machine_ip]
end end
# Returns the IP address of the first host only network adapter # Returns the IP address of the first host only network adapter

View File

@ -185,6 +185,10 @@ en:
nfs_no_host_ip: |- nfs_no_host_ip: |-
No host IP was given to the Vagrant core NFS helper. This is No host IP was given to the Vagrant core NFS helper. This is
an internal error that should be reported as a bug. an internal error that should be reported as a bug.
nfs_no_hostonly_network: |-
NFS requires a host-only network with a static IP to be created.
Please add a host-only network with a static IP to the machine
for NFS to work.
no_env: |- no_env: |-
A Vagrant environment is required to run this command. Run `vagrant init` A Vagrant environment is required to run this command. Run `vagrant init`
to set one up in this directory, or change to a directory with a to set one up in this directory, or change to a directory with a