Check for error when creating ip reso

This commit is contained in:
Matthew Hooker 2018-01-23 14:16:51 -08:00
parent 7d23cfae0a
commit b9a90b9261
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1
1 changed files with 5 additions and 2 deletions

View File

@ -24,8 +24,11 @@ func (s *stepCreateIPReservation) Run(state multistep.StateBag) multistep.StepAc
Name: fmt.Sprintf("ipres_%s", config.ImageName),
}
ipRes, err := iprClient.CreateIPReservation(IPInput)
if err != nil {
log.Printf("Error creating IP Reservation: %s", err)
err := fmt.Errorf("Error creating IP Reservation: %s", err)
state.Put("error", err)
ui.Error(err.Error())
return multistep.ActionHalt
}
state.Put("instance_ip", ipRes.IP)
@ -34,5 +37,5 @@ func (s *stepCreateIPReservation) Run(state multistep.StateBag) multistep.StepAc
}
func (s *stepCreateIPReservation) Cleanup(state multistep.StateBag) {
// Nothing to do
// TODO: delete ip reservation
}