builder/amazon/common: sleep between API calls for SSHAddr

This commit is contained in:
Mitchell Hashimoto 2013-08-03 16:38:21 -07:00
parent 4acdeb2832
commit 8286536180
1 changed files with 2 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import (
"fmt" "fmt"
"github.com/mitchellh/goamz/ec2" "github.com/mitchellh/goamz/ec2"
"github.com/mitchellh/packer/communicator/ssh" "github.com/mitchellh/packer/communicator/ssh"
"time"
) )
// SSHAddress returns a function that can be given to the SSH communicator // SSHAddress returns a function that can be given to the SSH communicator
@ -35,6 +36,7 @@ func SSHAddress(e *ec2.EC2, port int) func(map[string]interface{}) (string, erro
} }
state["instance"] = &r.Reservations[0].Instances[0] state["instance"] = &r.Reservations[0].Instances[0]
time.Sleep(1 * time.Second)
} }
return "", errors.New("couldn't determine IP address for instance") return "", errors.New("couldn't determine IP address for instance")