mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-11 01:30:06 -04:00
builder/amazonebs: Handle interrupts while waiting for SSH
This commit is contained in:
parent
417f7e7f47
commit
352f875dbf
1 changed files with 5 additions and 0 deletions
|
|
@ -83,6 +83,11 @@ ConnectWaitLoop:
|
|||
case <-timeout:
|
||||
ui.Error("Timeout while waiting to connect to SSH.")
|
||||
return multistep.ActionHalt
|
||||
case <-time.After(1 * time.Second):
|
||||
if _, ok := state[multistep.StateCancelled]; ok {
|
||||
log.Println("Interrupt detected, quitting waiting for SSH.")
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue