send logs about floppy failure directly to UI not just logs (#9272)

This commit is contained in:
Megan Marsh 2020-05-25 03:02:29 -07:00 committed by GitHub
parent fecb040bf4
commit 5dfd2a763e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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))
}
}