Incorporate code review feedback.

This commit is contained in:
Steven Merrill 2013-06-30 11:09:05 -04:00
parent dbad9a4058
commit fc06324ca0
1 changed files with 1 additions and 2 deletions

View File

@ -3,7 +3,6 @@ package vmware
import ( import (
"github.com/mitchellh/multistep" "github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer" "github.com/mitchellh/packer/packer"
"log"
"os" "os"
"fmt" "fmt"
) )
@ -16,13 +15,13 @@ func (*stepUploadTools) Run(state map[string]interface{}) multistep.StepAction {
driver := state["driver"].(Driver) driver := state["driver"].(Driver)
ui.Say("Uploading the VMware Tools.") ui.Say("Uploading the VMware Tools.")
log.Println("Uploading the VMware Tools.")
f, err := os.Open(driver.ToolsIsoPath()) f, err := os.Open(driver.ToolsIsoPath())
if err != nil { if err != nil {
state["error"] = fmt.Errorf("Error opening VMware Tools ISO: %s", err) state["error"] = fmt.Errorf("Error opening VMware Tools ISO: %s", err)
return multistep.ActionHalt return multistep.ActionHalt
} }
defer f.Close()
if err := comm.Upload("/tmp/linux.iso", f); err != nil { if err := comm.Upload("/tmp/linux.iso", f); err != nil {
state["error"] = fmt.Errorf("Error uploading VMware Tools: %s", err) state["error"] = fmt.Errorf("Error uploading VMware Tools: %s", err)