Merge pull request #11359 from briancain/fix/validate-synced_folder-types

Fixes #11358: Actually validate synced_folder type options
This commit is contained in:
Brian Cain 2020-01-31 12:53:14 -08:00 committed by GitHub
commit 7b6af85fa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 3 deletions

View File

@ -755,9 +755,14 @@ module VagrantPlugins
errors << I18n.t("vagrant.config.vm.shared_folder_mount_options_array")
end
# One day remove this probably.
if options[:extra]
errors << "The 'extra' flag on synced folders is now 'mount_options'"
if options[:type]
plugins = Vagrant.plugin("2").manager.synced_folders
impl_class = plugins[options[:type]]
if !impl_class
errors << I18n.t("vagrant.config.vm.shared_folder_invalid_option_type",
type: options[:type],
options: plugins.keys.join(', '))
end
end
end

View File

@ -1943,6 +1943,12 @@ en:
The shared folder guest path must be absolute: %{path}
shared_folder_hostpath_missing: |-
The host path of the shared folder is missing: %{path}
shared_folder_invalid_option_type: |-
The type '%{type}' is not a valid synced folder type. If 'type' is not
specified, Vagrant will automatically choose the best synced folder
option for your guest. Otherwise, please pick from the following available options:
%{options}
shared_folder_nfs_owner_group: |-
Shared folders that have NFS enabled do not support owner/group
attributes. Host path: %{path}