builder/amazon: handle cases when amazon SG isn't available [GH-494]
This commit is contained in:
parent
2b801a7b12
commit
8204944c0e
|
@ -78,6 +78,8 @@ BUG FIXES:
|
||||||
before a "/" [GH-716]
|
before a "/" [GH-716]
|
||||||
* core: "{{timestamp}}" values will always be the same for the entire
|
* core: "{{timestamp}}" values will always be the same for the entire
|
||||||
duration of a build. [GH-744]
|
duration of a build. [GH-744]
|
||||||
|
* builder/amazon: Handle cases where security group isn't instantly
|
||||||
|
available. [GH-494]
|
||||||
* builder/virtualbox: don't download guest additions if disabled. [GH-731]
|
* builder/virtualbox: don't download guest additions if disabled. [GH-731]
|
||||||
* post-processor/vsphere: Uploads VM properly. [GH-694]
|
* post-processor/vsphere: Uploads VM properly. [GH-694]
|
||||||
* post-processor/vsphere: Process user variables.
|
* post-processor/vsphere: Process user variables.
|
||||||
|
|
|
@ -61,7 +61,17 @@ func (s *StepSecurityGroup) Run(state multistep.StateBag) multistep.StepAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
ui.Say("Authorizing SSH access on the temporary security group...")
|
ui.Say("Authorizing SSH access on the temporary security group...")
|
||||||
if _, err := ec2conn.AuthorizeSecurityGroup(groupResp.SecurityGroup, perms); err != nil {
|
for i := 0; i < 5; i++ {
|
||||||
|
_, err = ec2conn.AuthorizeSecurityGroup(groupResp.SecurityGroup, perms)
|
||||||
|
if err == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Printf("Error authorizing. Will sleep and retry. %s", err)
|
||||||
|
time.Sleep((time.Duration(i) * time.Second) + 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
err := fmt.Errorf("Error creating temporary security group: %s", err)
|
err := fmt.Errorf("Error creating temporary security group: %s", err)
|
||||||
state.Put("error", err)
|
state.Put("error", err)
|
||||||
ui.Error(err.Error())
|
ui.Error(err.Error())
|
||||||
|
|
Loading…
Reference in New Issue