builder/amazon/common: wait for AMI to be available [GH-207]
This commit is contained in:
parent
234508376a
commit
83aca618d8
|
@ -18,6 +18,8 @@ IMPROVEMENTS:
|
|||
|
||||
BUG FIXES:
|
||||
|
||||
* builder/amazon/all: Gracefully handle when AMI appears to not exist
|
||||
while AWS state is propogating. [GH-207]
|
||||
* builder/virtualbox: Trim carriage returns for Windows to properly
|
||||
detect VM state on Windows. [GH-218]
|
||||
* core: build names no longer cause invalid config errors. [GH-197]
|
||||
|
|
|
@ -11,6 +11,11 @@ func WaitForAMI(c *ec2.EC2, imageId string) error {
|
|||
for {
|
||||
imageResp, err := c.Images([]string{imageId}, ec2.NewFilter())
|
||||
if err != nil {
|
||||
if ec2err, ok := err.(*ec2.Error); ok && ec2err.Code == "InvalidAMIID.NotFound" {
|
||||
log.Println("AMI not found, probably state issues on AWS side. Trying again.")
|
||||
continue
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue