Error if OSE version is detected

This commit is contained in:
Mitchell Hashimoto 2010-04-19 17:06:27 -07:00
parent 376cd2f24d
commit 28eb56b9f8
3 changed files with 14 additions and 0 deletions

View File

@ -37,6 +37,8 @@ module Vagrant
error_and_exit(:virtualbox_not_detected)
elsif version.to_f < 3.1
error_and_exit(:virtualbox_invalid_version, :version => version.to_s)
elsif version.to_s.downcase.include?("ose")
error_and_exit(:virtualbox_invalid_ose, :version => version.to_s)
end
end
end

View File

@ -118,6 +118,11 @@
Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed.
If VirtualBox is installed, it may be an incorrect version. Vagrant currently
only supports VirtualBox 3.1.x. Please install the proper version to continue.
:virtualbox_invalid_ose: |-
Vagrant has detected you're using an OSE ("Open Source Edition") of VirtualBox.
Vagrant currently doesn't support any of the OSE editions due to slight API
differences. Please download the regular package from virtualbox.org and install
to continue.
:vm_failed_to_boot: |-
Failed to connect to VM! Failed to boot?
:vm_base_not_found: |-

View File

@ -24,6 +24,13 @@ class EnvironmentTest < Test::Unit::TestCase
VirtualBox.expects(:version).returns(version)
Vagrant::Environment.check_virtualbox!
end
should "error and exit for OSE VirtualBox" do
version = "3.1.6_OSE"
Vagrant::Environment.expects(:error_and_exit).with(:virtualbox_invalid_ose, :version => version.to_s).once
VirtualBox.expects(:version).returns(version)
Vagrant::Environment.check_virtualbox!
end
end
context "class method load!" do