From 22b2d52e0085ab0eb1c288fd36dbdf8925d3d7ea Mon Sep 17 00:00:00 2001 From: sophia Date: Mon, 27 Jun 2022 14:50:03 -0500 Subject: [PATCH] Get communicator specified in Vagrnatfile --- internal/core/target.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/internal/core/target.go b/internal/core/target.go index e80513b6d..4278afde9 100644 --- a/internal/core/target.go +++ b/internal/core/target.go @@ -145,9 +145,16 @@ func (t *Target) Communicate() (c core.Communicator, err error) { c = i.(core.Communicator) return } - // TODO: get the communicator name from the Vagrantfile - // eg. t.target.Configuration.ConfigVm.Communicator - communicatorName := "ssh" + rawCommunicatorName, err := t.vagrantfile.GetValue("vm", "communicator") + if err != nil { + return nil, err + } + communicatorName := "" + if rawCommunicatorName == nil { + communicatorName = "ssh" + } else { + communicatorName = rawCommunicatorName.(string) + } communicator, err := t.project.basis.component( t.ctx, component.CommunicatorType, communicatorName)