mirror of
https://github.com/hashicorp/packer.git
synced 2026-05-28 04:35:38 -04:00
Save the spot request before waiting for its active state
This commit is contained in:
parent
1e1fa3de26
commit
3980c7dcfd
1 changed files with 3 additions and 3 deletions
|
|
@ -113,7 +113,8 @@ func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepActi
|
|||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
spotRequestId := runSpotResp.SpotRequestResults[0].SpotRequestId
|
||||
s.spotRequest = &runSpotResp.SpotRequestResults[0]
|
||||
spotRequestId := s.spotRequest.SpotRequestId
|
||||
ui.Say(fmt.Sprintf("Waiting for spot request (%s) to become ready...", spotRequestId))
|
||||
stateChange := StateChangeConf{
|
||||
Pending: []string{"open"},
|
||||
|
|
@ -135,8 +136,7 @@ func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepActi
|
|||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
s.spotRequest = &spotResp.SpotRequestResults[0]
|
||||
instanceId = []string{s.spotRequest.InstanceId}
|
||||
instanceId = []string{spotResp.SpotRequestResults[0].InstanceId}
|
||||
}
|
||||
|
||||
instanceResp, err := ec2conn.Instances(instanceId, nil)
|
||||
|
|
|
|||
Loading…
Reference in a new issue