Get default provider from go side

For now the go side will just return a hard coded value for the
default provider. It should be implementing the algorithm defined
at https://www.vagrantup.com/docs/providers/basic_usage.html#default-provider
This commit is contained in:
sophia 2022-04-13 10:52:58 -05:00
parent 92a0b1c541
commit 053d658e52
2 changed files with 8 additions and 9 deletions

View File

@ -100,8 +100,9 @@ func (p *Project) DefaultPrivateKey() (path path.Path, err error) {
// DefaultProvider implements core.Project
func (p *Project) DefaultProvider() (name string, err error) {
// TODO
return
// TODO: This needs to implement the default provider algorithm
// from https://www.vagrantup.com/docs/providers/basic_usage.html#default-provider
return "virtualbox", nil
}
// Home implements core.Project

View File

@ -24,8 +24,8 @@ module Vagrant
opts[:ui_class] ||= UI::Remote
@cwd = Pathname.new(@client.cwd)
@home_path = @client.respond_to?(:home) && Pathname.new(@client.home)
@vagrantfile_name = @client.respond_to?(:vagrantfile_name) && [@client.vagrantfile_name]
@home_path = Pathname.new(@client.home)
@vagrantfile_name = Array(@client.vagrantfile_name)
@ui = opts.fetch(:ui, opts[:ui_class].new(@client.ui))
@local_data_path = Pathname.new(@client.local_data)
@boxes_path = @home_path && @home_path.join("boxes")
@ -101,11 +101,9 @@ module Vagrant
@config_loader
end
# TODO: for now don't interfere with the default_provider method
# once it is implemented on the Go side then this can be uncommented
# def default_provider(**opts)
# client.default_provider
# end
def default_provider(**opts)
client.default_provider.to_sym
end
# Returns the host object associated with this environment.
#