Set default communicator constant
This commit is contained in:
parent
935c665412
commit
b01ace79f0
@ -30,6 +30,8 @@ import (
|
||||
"github.com/hashicorp/vagrant/internal/serverclient"
|
||||
)
|
||||
|
||||
const DEFAULT_COMMUNICATOR_NAME = "ssh"
|
||||
|
||||
type Target struct {
|
||||
ctx context.Context
|
||||
target *vagrant_server.Target
|
||||
@ -149,12 +151,15 @@ func (t *Target) Communicate() (c core.Communicator, err error) {
|
||||
rawCommunicatorName, err := t.vagrantfile.GetValue("vm", "communicator")
|
||||
// If there is an error getting the communicator, default to using the ssh communicator
|
||||
if err != nil {
|
||||
communicatorName = "ssh"
|
||||
communicatorName = DEFAULT_COMMUNICATOR_NAME
|
||||
}
|
||||
if rawCommunicatorName == nil {
|
||||
communicatorName = "ssh"
|
||||
communicatorName = DEFAULT_COMMUNICATOR_NAME
|
||||
} else {
|
||||
communicatorName = rawCommunicatorName.(string)
|
||||
communicatorName, err = optionToString(rawCommunicatorName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
communicator, err := t.project.basis.component(
|
||||
t.ctx, component.CommunicatorType, communicatorName)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user