From 5dfd2a763e05ee4870513a60b9a2cb6349bb9342 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Mon, 25 May 2020 03:02:29 -0700 Subject: [PATCH] send logs about floppy failure directly to UI not just logs (#9272) --- builder/virtualbox/common/step_attach_floppy.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/builder/virtualbox/common/step_attach_floppy.go b/builder/virtualbox/common/step_attach_floppy.go index 3af76e0cf..2003d4301 100644 --- a/builder/virtualbox/common/step_attach_floppy.go +++ b/builder/virtualbox/common/step_attach_floppy.go @@ -88,6 +88,8 @@ func (s *StepAttachFloppy) Run(ctx context.Context, state multistep.StateBag) mu } func (s *StepAttachFloppy) Cleanup(state multistep.StateBag) { + ui := state.Get("ui").(packer.Ui) + ui.Say("Cleaning up floppy disk...") if s.floppyPath == "" { return } @@ -107,7 +109,8 @@ func (s *StepAttachFloppy) Cleanup(state multistep.StateBag) { } if err := driver.VBoxManage(command...); err != nil { - log.Printf("Error unregistering floppy: %s", err) + ui.Error(fmt.Sprintf("Error unregistering floppy: %s. "+ + "Not considering this a critical failure; build will continue.", err)) } }