Action warden doesn't do recovery process on `SystemExit` exceptions, allowing double ctrl-C to work properly again.

This commit is contained in:
Mitchell Hashimoto 2010-10-01 10:08:38 -07:00
parent a17e05475d
commit cf823cadb5
3 changed files with 20 additions and 0 deletions

View File

@ -1,5 +1,7 @@
## 0.6.4 (unreleased)
- Action warden doesn't do recovery process on `SystemExit` exceptions,
allowing the double ctrl-C to work properly again. [related to GH-166]
- Initial Vagrantfile is now heavily commented with various available
options. [GH-171]
- Box add checks if a box already exists before the download. [GH-170]

View File

@ -26,6 +26,10 @@ module Vagrant
raise Errors::VagrantInterrupt.new if env.interrupted?
@stack.unshift(@actions.shift).first.call(env)
raise Errors::VagrantInterrupt.new if env.interrupted?
rescue SystemExit
# This means that an "exit" or "abort" was called. In these cases,
# we just exit immediately.
raise
rescue Exception => e
env["vagrant.error"] = e

View File

@ -70,6 +70,20 @@ class ActionWardenTest < Test::Unit::TestCase
assert_raises(RuntimeError) { @instance.call(new_env) }
end
should "not begin recovery sequence if a SystemExit is raised" do
class Foo
def initialize(*args); end
def call(env)
# Raises a system exit
abort
end
end
@instance.actions << Foo.new
@instance.expects(:begin_rescue).never
assert_raises(SystemExit) { @instance.call(new_env) }
end
should "raise interrupt if the environment is interupted" do
env = new_env
env.expects(:interrupted?).returns(true)