lib/vagrant/plugin/v2/trigger.rb in vagrant-unbundled-2.2.4.0 vs lib/vagrant/plugin/v2/trigger.rb in vagrant-unbundled-2.2.5.0
- old
+ new
@@ -108,11 +108,11 @@
filter.each do |trigger|
index = nil
match = false
if trigger.only_on
trigger.only_on.each do |o|
- if o.match(guest_name)
+ if o.match(guest_name.to_s)
# trigger matches on current guest, so we're fine to use it
match = true
break
end
end
@@ -298,11 +298,20 @@
# Exits Vagrant immediately
#
# @param [Integer] code Code to exit Vagrant on
def trigger_abort(exit_code)
- @ui.warn(I18n.t("vagrant.trigger.abort"))
- exit(exit_code)
+ if Thread.current[:batch_parallel_action]
+ @ui.warn(I18n.t("vagrant.trigger.abort_threaded"))
+ @logger.debug("Trigger abort within parallel batch action. " \
+ "Setting exit code and terminating.")
+ Thread.current[:exit_code] = exit_code
+ Thread.current.terminate
+ else
+ @ui.warn(I18n.t("vagrant.trigger.abort"))
+ @logger.debug("Trigger abort within non-parallel action, exiting directly")
+ Process.exit!(exit_code)
+ end
end
# Calls the given ruby block for execution
#
# @param [Proc] ruby_block