Fix to runner to get interrupts working again
This commit is contained in:
parent
f261c0571f
commit
0304f78a84
|
@ -3,7 +3,6 @@ require 'log4r'
|
||||||
require 'vagrant/util/busy'
|
require 'vagrant/util/busy'
|
||||||
|
|
||||||
# TODO:
|
# TODO:
|
||||||
# * env.ui
|
|
||||||
# * env.lock
|
# * env.lock
|
||||||
|
|
||||||
module Vagrant
|
module Vagrant
|
||||||
|
@ -31,13 +30,14 @@ module Vagrant
|
||||||
# Run the action chain in a busy block, marking the environment as
|
# Run the action chain in a busy block, marking the environment as
|
||||||
# interrupted if a SIGINT occurs, and exiting cleanly once the
|
# interrupted if a SIGINT occurs, and exiting cleanly once the
|
||||||
# chain has been run.
|
# chain has been run.
|
||||||
|
ui = environment[:ui] if environment.has_key?(:ui)
|
||||||
int_callback = lambda do
|
int_callback = lambda do
|
||||||
if environment.interrupted?
|
if environment.interrupted?
|
||||||
env.ui.error I18n.t("vagrant.actions.runner.exit_immediately")
|
ui.error I18n.t("vagrant.actions.runner.exit_immediately") if ui
|
||||||
abort
|
abort
|
||||||
end
|
end
|
||||||
|
|
||||||
env.ui.warn I18n.t("vagrant.actions.runner.waiting_cleanup") if !@@reported_interrupt
|
ui.warn I18n.t("vagrant.actions.runner.waiting_cleanup") if ui && !@@reported_interrupt
|
||||||
environment.interrupt!
|
environment.interrupt!
|
||||||
@@reported_interrupt = true
|
@@reported_interrupt = true
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue