Show special error if VirtualBox not detected on 64-bit Win

This commit is contained in:
Mitchell Hashimoto 2010-12-18 20:50:32 -08:00
parent c9f14d6dc9
commit c3b26dc4bf
4 changed files with 30 additions and 1 deletions

View File

@ -9,6 +9,7 @@
- BSD hosts use proper GNU sed syntax for clearing NFS shares. [GH-243]
- Enumerate VMs in a multi-VM environment in order they were defined. [GH-244]
- Check for VM boot changed to use `timeout` library, which works better with Windows.
- Show special error if VirtualBox not detected on 64-bit Windows.
## 0.6.8 (November 30, 2010)

View File

@ -34,6 +34,14 @@ module Vagrant
raise Errors::VirtualBoxNotDetected.new if version.nil?
raise Errors::VirtualBoxInvalidVersion.new(:version => version.to_s) if version.to_f < 3.2
raise Errors::VirtualBoxInvalidOSE.new(:version => version.to_s) if version.to_s.downcase.include?("ose")
rescue Errors::VirtualBoxNotDetected
# On 64-bit Windows, show a special error. This error is a subclass
# of VirtualBoxNotDetected, so libraries which use Vagrant can just
# rescue VirtualBoxNotDetected.
raise Errors::VirtualBoxNotDetected_Win64 if Util::Platform.windows? && Util::Platform.bit64?
# Otherwise, reraise the old error
raise
end
end

View File

@ -283,6 +283,15 @@ module Vagrant
error_key(:virtualbox_not_detected)
end
# Note that this is a subclass of VirtualBoxNotDetected, so developers
# who script Vagrant or use it as a library in any way can rescue from
# "VirtualBoxNotDetected" and catch both errors, which represent the
# same thing. This subclass simply has a specialized error message.
class VirtualBoxNotDetected_Win64 < VirtualBoxNotDetected
status_code(48)
error_key(:virtualbox_not_detected_win64)
end
class VMBaseMacNotSpecified < VagrantError
status_code(47)
error_key(:no_base_mac, "vagrant.actions.vm.match_mac")

View File

@ -14,7 +14,7 @@ en:
the VM and is required for chef provisioning. Please verify that chef
is installed and that the binary is available on the PATH.
puppet_not_detected: |-
The `puppet` binary was not found on the VM and is required for Puppet provisioning.
The `puppet` binary was not found on the VM and is required for Puppet provisioning.
Please verify that Puppet is installed and that the binary is available on the PATH.
cli_missing_env: This command requires that a Vagrant environment be properly passed in as the last parameter.
config_validation: |-
@ -102,6 +102,17 @@ en:
Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed.
If VirtualBox is installed, it may be an incorrect version. Vagrant currently
requires VirtualBox 3.2.x. Please install the proper version to continue.
virtualbox_not_detected_win64: |-
Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed
with version 3.2.0 or higher.
Additionally, it appears you're on 64-bit Windows. If this is the case, and
VirtualBox is properly installed with the correct version, then please make
sure you're running Vagrant via JRuby on a 64-bit Java runtime. For more
information on how to set this up and how to verify it is properly setup,
please view the guide online at:
URL TODO
vm_creation_required: "VM must be created before running this command. Run `vagrant up` first."
vm_not_found: "A VM by the name of %{name} was not found."
vm_not_running: "VM must be running to open SSH connection."