Commit 28064dbf authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

Merge pull request #60 from mitchellh/amazon-request-limit

builder/amazonebs: sleep between checks for ami create
parents aa3805c3 9751a71c
...@@ -6,6 +6,7 @@ import ( ...@@ -6,6 +6,7 @@ import (
"github.com/mitchellh/goamz/ec2" "github.com/mitchellh/goamz/ec2"
"github.com/mitchellh/multistep" "github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer" "github.com/mitchellh/packer/packer"
"log"
"strconv" "strconv"
"text/template" "text/template"
"time" "time"
...@@ -68,6 +69,11 @@ func (s *stepCreateAMI) Run(state map[string]interface{}) multistep.StepAction { ...@@ -68,6 +69,11 @@ func (s *stepCreateAMI) Run(state map[string]interface{}) multistep.StepAction {
if imageResp.Images[0].State == "available" { if imageResp.Images[0].State == "available" {
break break
} }
log.Printf("Image in state %s, sleeping 2s before checking again",
imageResp.Images[0].State)
time.Sleep(2 * time.Second)
} }
return multistep.ActionContinue return multistep.ActionContinue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment