From 7a77abeb19783d0d7d73daddc4ac2faaf442c22e Mon Sep 17 00:00:00 2001 From: Brian J Lovin Date: Fri, 17 May 2019 17:44:01 +0000 Subject: [PATCH] Fix progress output for ISO generation The way this was coded was causing bugs in output when creating an ISO image. The most obvious was the line "Cleaning up from ISO creation" would be repeated a few times at the end of execution. Having sub-progress loops doesn't make sense here, since the flow is "task"->"completion status" not "task"->"subtask"->"sub complete"->"task complete" Also, the removed progress loops would fail to be printed anyways, so removing them doesn't change progress output except for fixing this bug. Signed-off-by: Brian J Lovin --- controller/controller.go | 11 ++--------- isoutils/isoutils.go | 4 ++-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/controller/controller.go b/controller/controller.go index 40ef1f8..118edec 100644 --- a/controller/controller.go +++ b/controller/controller.go @@ -409,13 +409,10 @@ func Install(rootDir string, model *model.SystemInstall, options args.Args) erro prg.Success() if model.MakeISO { - msg = "Generating ISO image" - prg = progress.NewLoop(msg) - log.Info(msg) + log.Info("Generating ISO image") if err = generateISO(rootDir, model, options); err != nil { log.ErrorError(err) } - prg.Success() } msg = utils.Locale.Get("Installation completed") @@ -762,9 +759,7 @@ func saveInstallResults(rootDir string, md *model.SystemInstall) error { // generateISO creates an ISO image from the just created raw image func generateISO(rootDir string, md *model.SystemInstall, options args.Args) error { var err error - msg := "Building ISO image" - prg := progress.NewLoop(msg) - log.Info(msg) + log.Info("Building ISO image") if !md.LegacyBios { for _, alias := range md.StorageAlias { @@ -775,10 +770,8 @@ func generateISO(rootDir string, md *model.SystemInstall, options args.Args) err } else { err = fmt.Errorf("cannot create ISO images for configurations with LegacyBios enabled") log.ErrorError(err) - prg.Failure() return err } - prg.Success() return err } diff --git a/isoutils/isoutils.go b/isoutils/isoutils.go index d7d64dc..849f537 100644 --- a/isoutils/isoutils.go +++ b/isoutils/isoutils.go @@ -37,7 +37,7 @@ var ( ) func mkTmpDirs() error { - msg := "Creating directory trees" + msg := "Making temp directories for ISO creation" prg := progress.NewLoop(msg) log.Info(msg) var err error @@ -79,7 +79,7 @@ func mkTmpDirs() error { } func mkRootfs() error { - msg := "making rootfs squashfs" + msg := "Making squashfs of rootfs" prg := progress.NewLoop(msg) log.Info(msg)