builder/vmware: break out the proper loop
This commit is contained in:
parent
ccfb4664cf
commit
c29d754fa8
|
@ -45,6 +45,7 @@ func (s *stepWaitForSSH) Run(state map[string]interface{}) multistep.StepAction
|
||||||
log.Printf("Waiting for SSH, up to timeout: %s", config.SSHWaitTimeout.String())
|
log.Printf("Waiting for SSH, up to timeout: %s", config.SSHWaitTimeout.String())
|
||||||
|
|
||||||
timeout := time.After(config.SSHWaitTimeout)
|
timeout := time.After(config.SSHWaitTimeout)
|
||||||
|
WaitLoop:
|
||||||
for {
|
for {
|
||||||
// Wait for either SSH to become available, a timeout to occur,
|
// Wait for either SSH to become available, a timeout to occur,
|
||||||
// or an interrupt to come through.
|
// or an interrupt to come through.
|
||||||
|
@ -56,7 +57,7 @@ func (s *stepWaitForSSH) Run(state map[string]interface{}) multistep.StepAction
|
||||||
}
|
}
|
||||||
|
|
||||||
state["communicator"] = comm
|
state["communicator"] = comm
|
||||||
break
|
break WaitLoop
|
||||||
case <-timeout:
|
case <-timeout:
|
||||||
ui.Error("Timeout waiting for SSH.")
|
ui.Error("Timeout waiting for SSH.")
|
||||||
s.cancel = true
|
s.cancel = true
|
||||||
|
|
Loading…
Reference in New Issue