Removed some delegated methods on VM to explicitly use `vm` attribute in actions so its more runner-agnostic.

This commit is contained in:
Mitchell Hashimoto 2010-02-24 00:34:54 -08:00
parent 26f9eca141
commit e4548508f2
5 changed files with 4 additions and 8 deletions

View File

@ -24,7 +24,7 @@ module Vagrant
def export
logger.info "Exporting VM to #{ovf_path} ..."
@runner.export(ovf_path)
@runner.vm.export(ovf_path, {}, true)
end
end
end

View File

@ -19,7 +19,7 @@ error
# TODO won't work if the first disk is not the boot disk or even if there are multiple disks
def find_hard_drive
@runner.storage_controllers.each do |sc|
@runner.vm.storage_controllers.each do |sc|
sc.devices.each do |d|
return d if d.image.is_a?(VirtualBox::HardDrive)
end

View File

@ -42,9 +42,5 @@ module Vagrant
end
def powered_off?; @vm.powered_off? end
def export(filename); @vm.export(filename, {}, true) end
def storage_controllers; @vm.storage_controllers end
end
end

View File

@ -60,7 +60,7 @@ class ExportActionTest < Test::Unit::TestCase
end
should "call export on the runner with the ovf path" do
@runner.expects(:export).with(@ovf_path).once
@vm.expects(:export).with(@ovf_path, {}, true).once
@action.export
end
end

View File

@ -21,7 +21,7 @@ class MoveHardDriveActionTest < Test::Unit::TestCase
controller = mock('controller')
controller.expects(:devices).returns([hd, dvd])
@mock_vm.expects(:storage_controllers).once.returns([controller])
@vm.expects(:storage_controllers).once.returns([controller])
assert_equal @action.find_hard_drive, hd
end