Load remote communincator

This commit is contained in:
sophia 2021-10-25 15:56:11 -05:00 committed by Paul Hinze
parent 10b4015455
commit 2e693b60fe
No known key found for this signature in database
GPG key ID: B69DEDF2D55501C0
2 changed files with 7 additions and 11 deletions

View file

@ -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

View file

@ -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