From aefe41a44ad0631d2095a6d99464f080e4f28533 Mon Sep 17 00:00:00 2001 From: Ali Rizvi-Santiago Date: Tue, 16 Jan 2018 13:27:21 -0600 Subject: [PATCH] Fixed an issue with the previous commit so that when the user does not specify the cdrom_adapter_type to fallback to the original decision made by the disk adapter type selection. --- builder/vmware/iso/step_create_vmx.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builder/vmware/iso/step_create_vmx.go b/builder/vmware/iso/step_create_vmx.go index 0eb753dc8..ffff9d999 100644 --- a/builder/vmware/iso/step_create_vmx.go +++ b/builder/vmware/iso/step_create_vmx.go @@ -428,7 +428,9 @@ func (s *stepCreateVMX) Run(_ context.Context, state multistep.StateBag) multist // cdrom adapter type are the same, then ensure that the cdrom is the // slave device on whatever bus the disk adapter is on. cdromAdapterType := strings.ToLower(config.CdromAdapterType) - if cdromAdapterType == diskAdapterType { + if cdromAdapterType == "" { + cdromAdapterType = templateData.CDROMType + } else if cdromAdapterType == diskAdapterType { templateData.CDROMType_MasterSlave = "1" } else { templateData.CDROMType_MasterSlave = "0"