`vagrant destroy` always forces the shutdown (does not attempt graceful)
This commit is contained in:
parent
4d042da99b
commit
d7e0172e2d
|
@ -3,7 +3,9 @@ module Vagrant
|
||||||
module VM
|
module VM
|
||||||
class Down < Base
|
class Down < Base
|
||||||
def prepare
|
def prepare
|
||||||
@runner.add_action(Halt) if @runner.vm.running?
|
# The true as the 2nd parameter always forces the shutdown so its
|
||||||
|
# fast (since we're destroying anyways)
|
||||||
|
@runner.add_action(Halt, true) if @runner.vm.running?
|
||||||
@runner.add_action(Destroy)
|
@runner.add_action(Destroy)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,8 @@ class DownActionTest < Test::Unit::TestCase
|
||||||
def setup_action_expectations(order)
|
def setup_action_expectations(order)
|
||||||
default_seq = sequence("default_seq")
|
default_seq = sequence("default_seq")
|
||||||
order.each do |action|
|
order.each do |action|
|
||||||
@runner.expects(:add_action).with(action).once.in_sequence(default_seq)
|
action = [action] unless action.is_a?(Array)
|
||||||
|
@runner.expects(:add_action).with(action.shift, *action).once.in_sequence(default_seq)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -24,7 +25,7 @@ class DownActionTest < Test::Unit::TestCase
|
||||||
|
|
||||||
should "add the halt action if the VM is running" do
|
should "add the halt action if the VM is running" do
|
||||||
@vm.expects(:running?).returns(true)
|
@vm.expects(:running?).returns(true)
|
||||||
setup_action_expectations([Vagrant::Actions::VM::Halt, Vagrant::Actions::VM::Destroy])
|
setup_action_expectations([[Vagrant::Actions::VM::Halt, true], Vagrant::Actions::VM::Destroy])
|
||||||
@action.prepare
|
@action.prepare
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue