builder/common: if cancel during SSH, cancel the attempts

This commit is contained in:
Mitchell Hashimoto 2013-07-15 14:10:30 +09:00
parent 29bfab0631
commit ac7807e7e5
1 changed files with 3 additions and 0 deletions

View File

@ -73,6 +73,9 @@ WaitLoop:
return multistep.ActionHalt
case <-time.After(1 * time.Second):
if _, ok := state[multistep.StateCancelled]; ok {
// The step sequence was cancelled, so cancel waiting for SSH
// and just start the halting process.
s.cancel = true
log.Println("Interrupt detected, quitting waiting for SSH.")
return multistep.ActionHalt
}