Don't check for errors when checking if a provider is usable

If a provider is unusable then Usable() will throw an error. When
checking for a default provider, Vagrant should not raise an error
if there is an issue with executing Usable().
This commit is contained in:
sophia 2022-09-08 18:21:21 -04:00
parent add66c4c2a
commit ccb89c0143
2 changed files with 2 additions and 5 deletions

View File

@ -392,10 +392,7 @@ func (p *Project) DefaultProvider(opts *core.DefaultProviderOptions) (string, er
if opts.CheckUsable {
logger.Debug("Checking usable on provider", "provider", pp.Name)
pluginImpl := plug.Plugin.(core.Provider)
usable, err := pluginImpl.Usable()
if err != nil {
return "", err
}
usable, _ := pluginImpl.Usable()
if !usable {
logger.Debug("Skipping unusable provider", "provider", pp.Name)
continue

View File

@ -351,7 +351,7 @@ module Vagrant
# then look there.
root_config = vagrantfile.config
if opts[:machine]
machine_info = vagrantfile.machine_config(opts[:machine])
machine_info = vagrantfile.machine_config(opts[:machine], nil, nil, nil)
root_config = machine_info[:config]
end