From abb6d77442d68a6d1f278f5300f65273a5d5c2df Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Mon, 19 Mar 2018 15:34:35 -0700 Subject: [PATCH] Move location of command validator --- plugins/kernel_v2/config/vm_trigger.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/kernel_v2/config/vm_trigger.rb b/plugins/kernel_v2/config/vm_trigger.rb index c0220f4ea..5ce358431 100644 --- a/plugins/kernel_v2/config/vm_trigger.rb +++ b/plugins/kernel_v2/config/vm_trigger.rb @@ -136,6 +136,11 @@ module VagrantPlugins commands.push(key) end + if !commands.include?(@command) + machine.ui.warn(I18n.t("vagrant.config.triggers.bad_command_warning", + cmd: @command)) + end + # TODO: Does it make sense to strip out the "shell provisioner" error key here? # We could add more context around triggers? if @run @@ -148,11 +153,6 @@ module VagrantPlugins errors.concat errorz["shell provisioner"] if !errorz.empty? end - if !commands.include?(@command) - machine.ui.warn(I18n.t("vagrant.config.triggers.bad_command_warning", - cmd: @command)) - end - if !@name.nil? && !@name.is_a?(String) errors << I18n.t("vagrant.config.triggers.name_bad_type", cmd: @command) end