diff --git a/internal/core/target.go b/internal/core/target.go index 2614557cc..339fc3543 100644 --- a/internal/core/target.go +++ b/internal/core/target.go @@ -96,16 +96,11 @@ func (t *Target) Communicate() (c core.Communicator, err error) { // TODO: get the communicator name from the Vagrantfile // eg. t.target.Configuration.ConfigVm.Communicator communicatorName := "ssh" - communicators, err := t.project.basis.typeComponents(t.ctx, component.CommunicatorType) + communicator, err := t.project.basis.component(t.ctx, component.CommunicatorType, communicatorName) if err != nil { return nil, err } - for name, c := range communicators { - if name == communicatorName { - t.communicator = c.Value.(core.Communicator) - - } - } + t.communicator = communicator.Value.(core.Communicator) return t.communicator, nil } diff --git a/plugins/commands/serve/client/communicator.rb b/plugins/commands/serve/client/communicator.rb index 3da06129d..169b9d96e 100644 --- a/plugins/commands/serve/client/communicator.rb +++ b/plugins/commands/serve/client/communicator.rb @@ -5,6 +5,7 @@ module VagrantPlugins class Communicator extend Util::Connector + include Util::HasSeeds::Client attr_reader :broker attr_reader :client diff --git a/plugins/commands/serve/service/communicator_service.rb b/plugins/commands/serve/service/communicator_service.rb index 0a7265a2b..271f46c05 100644 --- a/plugins/commands/serve/service/communicator_service.rb +++ b/plugins/commands/serve/service/communicator_service.rb @@ -10,6 +10,7 @@ module VagrantPlugins prepend Util::HasBroker prepend Util::ExceptionLogger prepend Util::HasLogger + include Util::HasSeeds::Service def initialize(*args, **opts, &block) super()