Raise proper error if there aren't any NIC slots available

This commit is contained in:
Mitchell Hashimoto 2013-01-11 15:56:56 -08:00
parent 7cd663391e
commit 48eaa93745
3 changed files with 12 additions and 1 deletions

View File

@ -437,6 +437,10 @@ module Vagrant
error_key(:virtualbox_invalid_version)
end
class VirtualBoxNoRoomForHighLevelNetwork < VagrantError
error_key(:virtualbox_no_room_for_high_level_network)
end
class VirtualBoxNotDetected < VagrantError
status_code(8)
error_key(:virtualbox_not_detected)

View File

@ -51,7 +51,7 @@ module VagrantPlugins
slot = options[:adapter]
if !slot
if available_slots.empty?
# TODO: Error that we have no room for this adapter
raise Vagrant::Errors::VirtualBoxNoRoomForHighLevelNetwork
end
slot = available_slots.shift

View File

@ -280,6 +280,13 @@ en:
VirtualBox is complaining that the installation is incomplete. Please
run `VBoxManage --version` to see the error message which should contain
instructions on how to fix this error.
virtualbox_no_room_for_high_level_network: |-
There is no available slots on the VirtualBox VM for the configured
high-level network interfaces. "private_network" and "public_network"
network configurations consume a single network adapter slot on the
VirtualBox VM. VirtualBox limits the number of slots to 8, and it
appears that every slot is in use. Please lower the number of used
network adapters.
virtualbox_not_detected: |-
Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed.
Vagrant uses the `VBoxManage` binary that ships with VirtualBox, and requires