Commit 52fb77a8 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/vmware: case-insensitive VMX creation [GH-608]

parent d138e6a9
......@@ -12,6 +12,10 @@ IMPROVEMENTS:
* builder/amazon/all: Can now specify a list of multiple security group
IDs to apply. [GH-499]
BUG FIXES:
* builder/vmware: VMX modifications are now case-insensitive. [GH-608]
## 0.3.11 (November 4, 2013)
FEATURES:
......
......@@ -33,7 +33,7 @@ func sshAddress(state multistep.StateBag) (string, error) {
var ok bool
macAddress := ""
if macAddress, ok = vmxData["ethernet0.address"]; !ok || macAddress == "" {
if macAddress, ok = vmxData["ethernet0.generatedAddress"]; !ok || macAddress == "" {
if macAddress, ok = vmxData["ethernet0.generatedaddress"]; !ok || macAddress == "" {
return "", errors.New("couldn't find MAC address in VMX")
}
}
......
......@@ -60,7 +60,7 @@ func (s stepCleanVMX) Run(state multistep.StateBag) multistep.StepAction {
if filename == isoPath {
// Change the CD-ROM device back to auto-detect to eject
vmxData[filenameKey] = "auto detect"
vmxData[match+".deviceType"] = "cdrom-raw"
vmxData[match+".devicetype"] = "cdrom-raw"
}
}
}
......
......@@ -8,6 +8,7 @@ import (
"log"
"os"
"path/filepath"
"strings"
)
type vmxTemplateData struct {
......@@ -79,6 +80,7 @@ func (s *stepCreateVMX) Run(state multistep.StateBag) multistep.StepAction {
log.Println("Setting custom VMX data...")
for k, v := range config.VMXData {
log.Printf("Setting VMX: '%s' = '%s'", k, v)
k = strings.ToLower(k)
vmxData[k] = v
}
}
......@@ -86,12 +88,12 @@ func (s *stepCreateVMX) Run(state multistep.StateBag) multistep.StepAction {
if floppyPathRaw, ok := state.GetOk("floppy_path"); ok {
log.Println("Floppy path present, setting in VMX")
vmxData["floppy0.present"] = "TRUE"
vmxData["floppy0.fileType"] = "file"
vmxData["floppy0.fileName"] = floppyPathRaw.(string)
vmxData["floppy0.filetype"] = "file"
vmxData["floppy0.filename"] = floppyPathRaw.(string)
}
// Set this so that no dialogs ever appear from Packer.
vmxData["msg.autoAnswer"] = "true"
vmxData["msg.autoanswer"] = "true"
vmxDir := config.OutputDir
if config.RemoteType != "" {
......
......@@ -24,7 +24,8 @@ func ParseVMX(contents string) map[string]string {
continue
}
results[matches[1]] = matches[2]
key := strings.ToLower(matches[1])
results[key] = matches[2]
}
return results
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment