From 00a5ca32aed10f2a789363cc2f5c5576580201b1 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 2 Jul 2013 09:09:55 -0700 Subject: [PATCH] builder/vmware: Style nitpick /cc @smerrill: I prefer to do state changes at the end. :) --- builder/vmware/step_create_disk.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/builder/vmware/step_create_disk.go b/builder/vmware/step_create_disk.go index e3fdc9272..34e9233c2 100644 --- a/builder/vmware/step_create_disk.go +++ b/builder/vmware/step_create_disk.go @@ -15,7 +15,7 @@ import ( // ui packer.Ui // // Produces: -// +// full_disk_path (string) - The full path to the created disk. type stepCreateDisk struct{} func (stepCreateDisk) Run(state map[string]interface{}) multistep.StepAction { @@ -25,7 +25,6 @@ func (stepCreateDisk) Run(state map[string]interface{}) multistep.StepAction { ui.Say("Creating virtual machine disk") full_disk_path := filepath.Join(config.OutputDir, config.DiskName+".vmdk") - state["full_disk_path"] = full_disk_path if err := driver.CreateDisk(full_disk_path, fmt.Sprintf("%dM", config.DiskSize)); err != nil { err := fmt.Errorf("Error creating disk: %s", err) state["error"] = err @@ -33,6 +32,8 @@ func (stepCreateDisk) Run(state map[string]interface{}) multistep.StepAction { return multistep.ActionHalt } + state["full_disk_path"] = full_disk_path + return multistep.ActionContinue }