builder/amazon-ebs: don't clean up AMI if doesn't exist [GH-1469]

pull/1470/head
Mitchell Hashimoto 12 years ago
parent 984b8835ca
commit dc0de7da49

@ -69,9 +69,12 @@ func (s *stepCreateAMI) Run(state multistep.StateBag) multistep.StepAction {
}
func (s *stepCreateAMI) Cleanup(state multistep.StateBag) {
if s.image == nil {
return
}
_, cancelled := state.GetOk(multistep.StateCancelled)
_, halted := state.GetOk(multistep.StateHalted)
if !cancelled && !halted {
return
}

Loading…
Cancel
Save