From e728c09301efc9949beabb40a01542b2739b9c8f Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 29 May 2015 13:30:52 -0700 Subject: [PATCH] post-processor/vagrant-cloud: in error, don't delete version [GH-2014] --- .../vagrant-cloud/step_create_version.go | 29 +------------------ 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/post-processor/vagrant-cloud/step_create_version.go b/post-processor/vagrant-cloud/step_create_version.go index 738614152..58c3051a7 100644 --- a/post-processor/vagrant-cloud/step_create_version.go +++ b/post-processor/vagrant-cloud/step_create_version.go @@ -55,31 +55,4 @@ func (s *stepCreateVersion) Run(state multistep.StateBag) multistep.StepAction { return multistep.ActionContinue } -func (s *stepCreateVersion) Cleanup(state multistep.StateBag) { - client := state.Get("client").(*VagrantCloudClient) - ui := state.Get("ui").(packer.Ui) - box := state.Get("box").(*Box) - version := state.Get("version").(*Version) - - _, cancelled := state.GetOk(multistep.StateCancelled) - _, halted := state.GetOk(multistep.StateHalted) - - // Return if we didn't cancel or halt, and thus need - // no cleanup - if !cancelled && !halted { - return - } - - path := fmt.Sprintf("box/%s/version/%v", box.Tag, version.Version) - - ui.Say("Cleaning up version") - ui.Message(fmt.Sprintf("Deleting version: %s", version.Version)) - - // No need for resp from the cleanup DELETE - _, err := client.Delete(path) - - if err != nil { - ui.Error(fmt.Sprintf("Error destroying version: %s", err)) - } - -} +func (s *stepCreateVersion) Cleanup(state multistep.StateBag) {}