From 9751a71ca790ddfd1b22d00f162858e43f60ada9 Mon Sep 17 00:00:00 2001 From: Jack Pearkes Date: Sat, 29 Jun 2013 12:34:24 +0200 Subject: [PATCH] builder/amazonebs: sleep between checks for ami create fixes #50 --- builder/amazonebs/step_create_ami.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/builder/amazonebs/step_create_ami.go b/builder/amazonebs/step_create_ami.go index 8fa1c005f..cca4a68b9 100644 --- a/builder/amazonebs/step_create_ami.go +++ b/builder/amazonebs/step_create_ami.go @@ -6,6 +6,7 @@ import ( "github.com/mitchellh/goamz/ec2" "github.com/mitchellh/multistep" "github.com/mitchellh/packer/packer" + "log" "strconv" "text/template" "time" @@ -68,6 +69,11 @@ func (s *stepCreateAMI) Run(state map[string]interface{}) multistep.StepAction { if imageResp.Images[0].State == "available" { break } + + log.Printf("Image in state %s, sleeping 2s before checking again", + imageResp.Images[0].State) + + time.Sleep(2 * time.Second) } return multistep.ActionContinue