From 2e693b60fedd3c6c0c2aef6247ef1a21cbc41bf3 Mon Sep 17 00:00:00 2001 From: sophia Date: Mon, 25 Oct 2021 15:56:11 -0500 Subject: [PATCH] Load remote communincator --- lib/vagrant/machine/remote.rb | 13 ++++--------- plugins/commands/serve/client/target.rb | 5 +++-- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/vagrant/machine/remote.rb b/lib/vagrant/machine/remote.rb index dbab0149e..88a6f5b12 100644 --- a/lib/vagrant/machine/remote.rb +++ b/lib/vagrant/machine/remote.rb @@ -194,16 +194,11 @@ module Vagrant end def communicate - # TODO: this should be communicating with the client.communicate - if !@communicator - requested = @config.vm.communicator - requested ||= :ssh - klass = Vagrant.plugin("2").manager.communicators[requested] - raise Errors::CommunicatorNotFound, comm: requested.to_s if !klass - @communicator = klass.new(self) + @logger.debug("Getting communicator from client") + if !@communicate + @communicate = Vagrant::Plugin::V2::Communicator.new(self) end - - @communicator + @communicate end def guest diff --git a/plugins/commands/serve/client/target.rb b/plugins/commands/serve/client/target.rb index 8f0ea73f4..ef0d99120 100644 --- a/plugins/commands/serve/client/target.rb +++ b/plugins/commands/serve/client/target.rb @@ -22,9 +22,10 @@ module VagrantPlugins SDK::Ref::Target.new(resource_id: resource_id) end - # @return [Communicator] - # TODO: Implement + # @return [Client::Communicator] def communicate + comm_raw = client.communicate(Empty.new) + Communicator.load(comm_raw, broker: @broker) end # @return [Pathname] target specific data directory