Run VM customizations when restarting a halted machine [closes GH-36]

This commit is contained in:
Mitchell Hashimoto 2010-03-20 01:59:32 -07:00
parent 86a1ff4ff8
commit 881aa833e6
2 changed files with 9 additions and 0 deletions

View File

@ -6,6 +6,7 @@ module Vagrant
# Start is a "meta-action" so it really just queues up a bunch
# of other actions in its place:
steps = [ForwardPorts, SharedFolders, Boot]
steps.unshift(Customize) unless @runner.vm.saved?
steps.each do |action_klass|
@runner.add_action(action_klass)

View File

@ -8,6 +8,7 @@ class StartActionTest < Test::Unit::TestCase
context "sub-actions" do
setup do
@vm.stubs(:saved?).returns(true)
File.stubs(:file?).returns(true)
File.stubs(:exist?).returns(true)
@default_order = [Vagrant::Actions::VM::ForwardPorts, Vagrant::Actions::VM::SharedFolders, Vagrant::Actions::VM::Boot]
@ -24,5 +25,12 @@ class StartActionTest < Test::Unit::TestCase
setup_action_expectations
@action.prepare
end
should "add customize to the beginning if its not saved" do
@vm.expects(:saved?).returns(false)
@default_order.unshift(Vagrant::Actions::VM::Customize)
setup_action_expectations
@action.prepare
end
end
end