From 0d19acd851e7b355e24cad4c3eba983687ffe653 Mon Sep 17 00:00:00 2001 From: Doug Davis Date: Sun, 26 Jun 2016 10:48:21 -0700 Subject: [PATCH] Remove blank line on daemon output when there are no containers to load Its a minor thing but the daemon's output looks like this when there are no containers to load: ``` INFO[0001] Loading containers: start. INFO[0001] Loading containers: done. ``` That blank line (or more correctly, the \n) is unnecessary when there are no containers to load since there is no `.` printed Signed-off-by: Doug Davis Upstream-commit: 478dd721ab7aca37264897b664dfa2ec953d7048 Component: engine --- components/engine/daemon/daemon.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/engine/daemon/daemon.go b/components/engine/daemon/daemon.go index 7ec71a1305..2090898298 100644 --- a/components/engine/daemon/daemon.go +++ b/components/engine/daemon/daemon.go @@ -117,11 +117,13 @@ func (daemon *Daemon) restore() error { return err } + containerCount := 0 for _, v := range dir { id := v.Name() container, err := daemon.load(id) if !debug && logrus.GetLevel() == logrus.InfoLevel { fmt.Print(".") + containerCount++ } if err != nil { logrus.Errorf("Failed to load container %v: %v", id, err) @@ -306,7 +308,7 @@ func (daemon *Daemon) restore() error { group.Wait() if !debug { - if logrus.GetLevel() == logrus.InfoLevel { + if logrus.GetLevel() == logrus.InfoLevel && containerCount > 0 { fmt.Println() } logrus.Info("Loading containers: done.")