Action warden doesn't do recovery process on `SystemExit` exceptions, allowing double ctrl-C to work properly again.
This commit is contained in:
parent
a17e05475d
commit
cf823cadb5
|
@ -1,5 +1,7 @@
|
||||||
## 0.6.4 (unreleased)
|
## 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
|
- Initial Vagrantfile is now heavily commented with various available
|
||||||
options. [GH-171]
|
options. [GH-171]
|
||||||
- Box add checks if a box already exists before the download. [GH-170]
|
- Box add checks if a box already exists before the download. [GH-170]
|
||||||
|
|
|
@ -26,6 +26,10 @@ module Vagrant
|
||||||
raise Errors::VagrantInterrupt.new if env.interrupted?
|
raise Errors::VagrantInterrupt.new if env.interrupted?
|
||||||
@stack.unshift(@actions.shift).first.call(env)
|
@stack.unshift(@actions.shift).first.call(env)
|
||||||
raise Errors::VagrantInterrupt.new if env.interrupted?
|
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
|
rescue Exception => e
|
||||||
env["vagrant.error"] = e
|
env["vagrant.error"] = e
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,20 @@ class ActionWardenTest < Test::Unit::TestCase
|
||||||
assert_raises(RuntimeError) { @instance.call(new_env) }
|
assert_raises(RuntimeError) { @instance.call(new_env) }
|
||||||
end
|
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
|
should "raise interrupt if the environment is interupted" do
|
||||||
env = new_env
|
env = new_env
|
||||||
env.expects(:interrupted?).returns(true)
|
env.expects(:interrupted?).returns(true)
|
||||||
|
|
Loading…
Reference in New Issue