From 31ac1da28d0ac249d10973748bc5c752afa20cd1 Mon Sep 17 00:00:00 2001 From: Taliesin Sisson Date: Sat, 31 Oct 2015 16:53:58 +0000 Subject: [PATCH] Setting boot drive message --- builder/hyperv/common/step_mount_dvddrive.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/builder/hyperv/common/step_mount_dvddrive.go b/builder/hyperv/common/step_mount_dvddrive.go index f31ef4c2c..f325ada94 100644 --- a/builder/hyperv/common/step_mount_dvddrive.go +++ b/builder/hyperv/common/step_mount_dvddrive.go @@ -13,7 +13,7 @@ import ( type StepMountDvdDrive struct { Generation uint - cleanup bool + cleanup bool dvdProperties DvdControllerProperties } @@ -24,7 +24,7 @@ func (s *StepMountDvdDrive) Run(state multistep.StateBag) multistep.StepAction { errorMsg := "Error mounting dvd drive: %s" vmName := state.Get("vmName").(string) isoPath := state.Get("iso_path").(string) - + // should be able to mount up to 60 additional iso images using SCSI // but Windows would only allow a max of 22 due to available drive letters // Will Windows assign DVD drives to A: and B: ? @@ -43,16 +43,16 @@ func (s *StepMountDvdDrive) Run(state multistep.StateBag) multistep.StepAction { dvdControllerProperties.ControllerLocation = controllerLocation s.cleanup = true s.dvdProperties = dvdControllerProperties - - ui.Say("Setting boot drive to os dvd drive %s ...") + + ui.Say(fmt.Sprintf("Setting boot drive to os dvd drive %s ..."), isoPath) err = driver.SetBootDvdDrive(vmName, controllerNumber, controllerLocation) if err != nil { err := fmt.Errorf(errorMsg, err) state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt - } - + } + ui.Say(fmt.Sprintf("Mounting os dvd drive %s ...", isoPath)) err = driver.MountDvdDrive(vmName, isoPath) if err != nil { @@ -61,7 +61,7 @@ func (s *StepMountDvdDrive) Run(state multistep.StateBag) multistep.StepAction { ui.Error(err.Error()) return multistep.ActionHalt } - + state.Put("os.dvd.properties", dvdControllerProperties) return multistep.ActionContinue @@ -80,9 +80,9 @@ func (s *StepMountDvdDrive) Cleanup(state multistep.StateBag) { ui := state.Get("ui").(packer.Ui) ui.Say("Clean up os dvd drive...") - + dvdControllerProperties := s.dvdProperties - + if dvdControllerProperties.Existing { err := driver.UnmountDvdDrive(vmName) if err != nil {