Update step_type_boot_command.go

This commit is contained in:
Ariel Sandor 2021-03-16 09:09:39 -03:00 committed by Daniel Koschützki
parent 02d6278161
commit f566af1fae

View File

@ -68,14 +68,13 @@ func (self *StepTypeBootCommand) Run(ctx context.Context, state multistep.StateB
}
location, err := c.client.Console.GetLocation(c.session, consoles[0])
ui.Say(fmt.Sprintf("LOCATION: %s", location))
if err != nil {
ui.Error(err.Error())
return multistep.ActionHalt
}
locationPieces := strings.SplitAfter(location, "/")
consoleHost := strings.TrimSuffix(locationPieces[2], "/")
ui.Say("Connecting to the VM console VNC over xapi")
ui.Say(fmt.Sprintf("Connecting to the VM console VNC over xapi via %s", consoleHost))
conn, err := net.Dial("tcp", fmt.Sprintf("%s:443", consoleHost))
if err != nil {
@ -271,4 +270,4 @@ func vncSendString(c *vnc.ClientConn, original string) {
// no matter what, wait a small period
time.Sleep(50 * time.Millisecond)
}
}
}