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
|
# get all triggers matching action
|
||||||
triggers = []
|
triggers = []
|
||||||
if stage == :before
|
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
|
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
|
else
|
||||||
raise Errors::TriggersNoStageGiven,
|
raise Errors::TriggersNoStageGiven,
|
||||||
action: action,
|
action: action,
|
||||||
|
|
|
@ -92,7 +92,7 @@ module VagrantPlugins
|
||||||
@info = nil if @info == UNSET_VALUE
|
@info = nil if @info == UNSET_VALUE
|
||||||
@warn = nil if @warn == UNSET_VALUE
|
@warn = nil if @warn == UNSET_VALUE
|
||||||
@on_error = DEFAULT_ON_ERROR if @on_error == 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 = nil if @run == UNSET_VALUE
|
||||||
@run_remote = nil if @run_remote == UNSET_VALUE
|
@run_remote = nil if @run_remote == UNSET_VALUE
|
||||||
@only_on = nil if @only_on == UNSET_VALUE
|
@only_on = nil if @only_on == UNSET_VALUE
|
||||||
|
@ -139,7 +139,7 @@ module VagrantPlugins
|
||||||
commands.push(key)
|
commands.push(key)
|
||||||
end
|
end
|
||||||
|
|
||||||
if !commands.include?(@command)
|
if !commands.include?(@command) && @command != :all
|
||||||
machine.ui.warn(I18n.t("vagrant.config.triggers.bad_command_warning",
|
machine.ui.warn(I18n.t("vagrant.config.triggers.bad_command_warning",
|
||||||
cmd: @command))
|
cmd: @command))
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue