Driver forwarding to 4.1 works properly

This commit is contained in:
Mitchell Hashimoto 2012-01-07 20:39:43 -08:00
parent 5157cccaef
commit 7954d4cba8
3 changed files with 8 additions and 3 deletions

View File

@ -41,7 +41,9 @@ module Vagrant
end
# Instantiate the proper version driver for VirtualBox
@driver = VirtualBox_4_1.new(@uuid)
driver_klass = VirtualBox_4_1
@logger.info("Using VirtualBox driver: #{driver_klass}")
@driver = driver_klass.new(@uuid)
if @uuid
# Verify the VM exists, and if it doesn't, then don't worry
@ -61,6 +63,7 @@ module Vagrant
:export,
:forward_ports,
:halt,
:import,
:read_forwarded_ports,
:read_bridged_interfaces,
:read_guest_additions_version,

View File

@ -7,6 +7,8 @@ module Vagrant
# Driver for VirtualBox 4.1.x
class VirtualBox_4_1 < VirtualBoxBase
def initialize(uuid)
super()
@logger = Log4r::Logger.new("vagrant::driver::virtualbox_4_1")
@uuid = uuid
end
@ -343,7 +345,7 @@ module Vagrant
end
def vm_exists?(uuid)
raw("showvminfo", uuid).exit_code != 0
raw("showvminfo", uuid).exit_code == 0
end
end
end

View File

@ -128,7 +128,7 @@ module Vagrant
# @param [String] ovf Path to the OVF file.
# @param [String] name Name of the VM.
# @return [String] UUID of the imported VM.
def import
def import(ovf, name)
end
# Returns a list of forwarded ports for a VM.