diff --git a/plugins/kernel_v2/config/vm_trigger.rb b/plugins/kernel_v2/config/vm_trigger.rb index 03c070fc8..7211bca88 100644 --- a/plugins/kernel_v2/config/vm_trigger.rb +++ b/plugins/kernel_v2/config/vm_trigger.rb @@ -113,6 +113,17 @@ module VagrantPlugins def validate(machine) errors = _detected_errors + commands = [] + # TODO: Should this be cached...? + Vagrant.plugin("2").manager.commands.each do |key,data| + commands.push(key) + end + + if !commands.include?(@command) + machine.ui.warn(I18n.t("vagrant.config.triggers.bad_command_warning", + cmd: @command)) + end + if !@run.nil? if !@run.is_a?(Hash) # Run must be a hash diff --git a/templates/locales/en.yml b/templates/locales/en.yml index e663515f0..06a50ef95 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -1678,6 +1678,8 @@ en: The key `paranoid` is deprecated. Please use `verify_host_key`. Supported values are exactly the same, only the name of the option has changed. triggers: + bad_command_warning: |- + The command '%{cmd}' was not found for this trigger. name_bad_type: |- Invalid type set for `name` on trigger for command '%{cmd}'. `name` should be a String. on_error_bad_type: |-