Display warning if vagrant command for trigger is not found

This commit is contained in:
Brian Cain 2018-03-13 15:14:18 -07:00
parent 8e72ae5bd6
commit 60ff2489c4
No known key found for this signature in database
GPG Key ID: 43D51080D357A001
2 changed files with 13 additions and 0 deletions

View File

@ -113,6 +113,17 @@ module VagrantPlugins
def validate(machine) def validate(machine)
errors = _detected_errors 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.nil?
if !@run.is_a?(Hash) if !@run.is_a?(Hash)
# Run must be a hash # Run must be a hash

View File

@ -1678,6 +1678,8 @@ en:
The key `paranoid` is deprecated. Please use `verify_host_key`. Supported The key `paranoid` is deprecated. Please use `verify_host_key`. Supported
values are exactly the same, only the name of the option has changed. values are exactly the same, only the name of the option has changed.
triggers: triggers:
bad_command_warning: |-
The command '%{cmd}' was not found for this trigger.
name_bad_type: |- name_bad_type: |-
Invalid type set for `name` on trigger for command '%{cmd}'. `name` should be a String. Invalid type set for `name` on trigger for command '%{cmd}'. `name` should be a String.
on_error_bad_type: |- on_error_bad_type: |-