mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-11 09:40:17 -04:00
builder/amazon-ebs: don't clean up AMI if doesn't exist [GH-1469]
This commit is contained in:
parent
984b8835ca
commit
dc0de7da49
1 changed files with 4 additions and 1 deletions
|
|
@ -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…
Reference in a new issue