From 1a36458e9ed15be76f9347d103e0ff5a98b8c28d Mon Sep 17 00:00:00 2001 From: Ali Rizvi-Santiago Date: Mon, 10 Dec 2018 16:24:27 -0600 Subject: [PATCH] Tiny fix to replace some duplicate code with usage of the `halt` closure in the StepCloneVMX step for the vmware-vmx builder. --- builder/vmware/vmx/step_clone_vmx.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/builder/vmware/vmx/step_clone_vmx.go b/builder/vmware/vmx/step_clone_vmx.go index 2028b5d3e..c1fa5f65e 100644 --- a/builder/vmware/vmx/step_clone_vmx.go +++ b/builder/vmware/vmx/step_clone_vmx.go @@ -39,9 +39,7 @@ func (s *StepCloneVMX) Run(_ context.Context, state multistep.StateBag) multiste log.Printf("Cloning to: %s", vmxPath) if err := driver.Clone(vmxPath, s.Path, s.Linked); err != nil { - state.Put("error", err) return halt(err) - } // Read in the machine configuration from the cloned VMX file @@ -102,8 +100,7 @@ func (s *StepCloneVMX) Run(_ context.Context, state multistep.StateBag) multiste } if len(diskFullPaths) == 0 { - state.Put("error", fmt.Errorf("Could not enumerate disk info from the vmx file")) - return multistep.ActionHalt + return halt(fmt.Errorf("Could not enumerate disk info from the vmx file")) } // Determine the network type by reading out of the .vmx