From 6130b8588d12a20a2a510547123826d82642c055 Mon Sep 17 00:00:00 2001 From: Jeremy Asher Date: Mon, 8 Aug 2016 14:16:43 -0700 Subject: [PATCH] remove check for AMIs when deleting vols This removes the unnecessary check for AMIs before cleaning up volumes. AMIs will exist on a successful run, but not when a build fails after instance creation (during provisioning for example). The following check for instance being nil should be sufficient. --- builder/amazon/ebs/step_cleanup_volumes.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/builder/amazon/ebs/step_cleanup_volumes.go b/builder/amazon/ebs/step_cleanup_volumes.go index 461bb7b9d..e9d33fa32 100644 --- a/builder/amazon/ebs/step_cleanup_volumes.go +++ b/builder/amazon/ebs/step_cleanup_volumes.go @@ -30,12 +30,6 @@ func (s *stepCleanupVolumes) Cleanup(state multistep.StateBag) { instance = instanceRaw.(*ec2.Instance) } ui := state.Get("ui").(packer.Ui) - amisRaw := state.Get("amis") - if amisRaw == nil { - ui.Say("No AMIs to cleanup") - return - } - if instance == nil { ui.Say("No volumes to clean up, skipping") return