1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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 <dug@us.ibm.com>
This commit is contained in:
Doug Davis 2016-06-26 10:48:21 -07:00
parent d4bff5e3aa
commit 478dd721ab

View file

@ -117,11 +117,13 @@ func (daemon *Daemon) restore() error {
return err return err
} }
containerCount := 0
for _, v := range dir { for _, v := range dir {
id := v.Name() id := v.Name()
container, err := daemon.load(id) container, err := daemon.load(id)
if !debug && logrus.GetLevel() == logrus.InfoLevel { if !debug && logrus.GetLevel() == logrus.InfoLevel {
fmt.Print(".") fmt.Print(".")
containerCount++
} }
if err != nil { if err != nil {
logrus.Errorf("Failed to load container %v: %v", id, err) logrus.Errorf("Failed to load container %v: %v", id, err)
@ -306,7 +308,7 @@ func (daemon *Daemon) restore() error {
group.Wait() group.Wait()
if !debug { if !debug {
if logrus.GetLevel() == logrus.InfoLevel { if logrus.GetLevel() == logrus.InfoLevel && containerCount > 0 {
fmt.Println() fmt.Println()
} }
logrus.Info("Loading containers: done.") logrus.Info("Loading containers: done.")