Ensure that :all triggers don't get filtered out
This commit is contained in:
parent
600557ff24
commit
85dedf25d9
|
@ -35,9 +35,13 @@ module Vagrant
|
|||
# get all triggers matching action
|
||||
triggers = []
|
||||
if stage == :before
|
||||
triggers = config.before_triggers.select { |t| t.command == action }
|
||||
triggers = config.before_triggers.select do |t|
|
||||
t.command == action || (t.command == :all && !t.ignore.any?(action))
|
||||
end
|
||||
elsif stage == :after
|
||||
triggers = config.after_triggers.select { |t| t.command == action }
|
||||
triggers = config.after_triggers.select do |t|
|
||||
t.command == action || (t.command == :all && !t.ignore.any?(action))
|
||||
end
|
||||
else
|
||||
raise Errors::TriggersNoStageGiven,
|
||||
action: action,
|
||||
|
|
|
@ -92,7 +92,7 @@ module VagrantPlugins
|
|||
@info = nil if @info == UNSET_VALUE
|
||||
@warn = nil if @warn == UNSET_VALUE
|
||||
@on_error = DEFAULT_ON_ERROR if @on_error == UNSET_VALUE
|
||||
@ignore = nil if @ignore == UNSET_VALUE
|
||||
@ignore = [] if @ignore == UNSET_VALUE
|
||||
@run = nil if @run == UNSET_VALUE
|
||||
@run_remote = nil if @run_remote == UNSET_VALUE
|
||||
@only_on = nil if @only_on == UNSET_VALUE
|
||||
|
@ -139,7 +139,7 @@ module VagrantPlugins
|
|||
commands.push(key)
|
||||
end
|
||||
|
||||
if !commands.include?(@command)
|
||||
if !commands.include?(@command) && @command != :all
|
||||
machine.ui.warn(I18n.t("vagrant.config.triggers.bad_command_warning",
|
||||
cmd: @command))
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue