Fixes #10358: Add validation error in salt provider for certain options

Prior to this commit, if you specified a `version` for the salt provider
but no `install_type` Vagrant would fail to pass the proper parameters
to the bootstrap install script. This commit fixes that by adding some
validation to the salt provider if `version` is specified but not
`install_type`. It also adds some extra context for certain config
validation error messages so that the user knows what option was
incorrect, rather than the message just referring to the option as
*this*.
This commit is contained in:
Brian Cain 2018-12-03 09:58:37 -08:00
parent e4a3eb5d14
commit 34b64ec247
No known key found for this signature in database
GPG Key ID: 9FC4639B2E4510A0
2 changed files with 8 additions and 2 deletions

View File

@ -177,6 +177,10 @@ module VagrantPlugins
errors << I18n.t("vagrant.provisioners.salt.python_version") errors << I18n.t("vagrant.provisioners.salt.python_version")
end end
if @version && !@install_type
errors << I18n.t("vagrant.provisioners.salt.version_type_missing")
end
return {"salt provisioner" => errors} return {"salt provisioner" => errors}
end end
end end

View File

@ -2701,9 +2701,11 @@ en:
must_accept_keys: |- must_accept_keys: |-
You must accept keys when running highstate with master! You must accept keys when running highstate with master!
args_array: |- args_array: |-
You must set this value as an array. You must set `args_array` value as an array.
python_version: |- python_version: |-
You must set this as an integer or string that represents an integer. You must set `python_version` as an integer or string that represents an integer.
version_type_missing: |-
You must set the option `install_type` when specifying a `version`.
pushes: pushes:
file: file: