Add a method to get the VMware Tools ISO path.
This commit is contained in:
parent
da3b0f54c7
commit
dbad9a4058
|
@ -24,6 +24,9 @@ type Driver interface {
|
|||
// Stop stops a VM specified by the path to the VMX given.
|
||||
Stop(string) error
|
||||
|
||||
// Get the path to the VMware ISO.
|
||||
ToolsIsoPath() string
|
||||
|
||||
// Verify checks to make sure that this driver should function
|
||||
// properly. This should check that all the files it will use
|
||||
// appear to exist and so on. If everything is okay, this doesn't
|
||||
|
@ -122,7 +125,7 @@ func (d *Fusion5Driver) vmrunPath() string {
|
|||
}
|
||||
|
||||
// @TODO: Be smarter about guest type before deciding on linux.iso.
|
||||
func (d *Fusion5Driver) vmwareToolsIsoPath() string {
|
||||
func (d *Fusion5Driver) ToolsIsoPath() string {
|
||||
return filepath.Join(d.AppPath, "Contents", "Library", "isoimages", "linux.iso")
|
||||
}
|
||||
|
||||
|
|
|
@ -4,10 +4,10 @@ import (
|
|||
"github.com/mitchellh/multistep"
|
||||
"github.com/mitchellh/packer/packer"
|
||||
"log"
|
||||
"os"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
a {
|
||||
|
||||
type stepUploadTools struct{}
|
||||
|
||||
func (*stepUploadTools) Run(state map[string]interface{}) multistep.StepAction {
|
||||
|
@ -18,7 +18,7 @@ func (*stepUploadTools) Run(state map[string]interface{}) multistep.StepAction {
|
|||
ui.Say("Uploading the VMware Tools.")
|
||||
log.Println("Uploading the VMware Tools.")
|
||||
|
||||
f, err := os.Open(driver.vmwareToolsIsoPath())
|
||||
f, err := os.Open(driver.ToolsIsoPath())
|
||||
if err != nil {
|
||||
state["error"] = fmt.Errorf("Error opening VMware Tools ISO: %s", err)
|
||||
return multistep.ActionHalt
|
||||
|
|
Loading…
Reference in New Issue