Browse code

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>

Doug Davis authored on 2016/06/27 02:48:21
Showing 1 changed files
... ...
@@ -117,11 +117,13 @@ func (daemon *Daemon) restore() error {
117 117
 		return err
118 118
 	}
119 119
 
120
+	containerCount := 0
120 121
 	for _, v := range dir {
121 122
 		id := v.Name()
122 123
 		container, err := daemon.load(id)
123 124
 		if !debug && logrus.GetLevel() == logrus.InfoLevel {
124 125
 			fmt.Print(".")
126
+			containerCount++
125 127
 		}
126 128
 		if err != nil {
127 129
 			logrus.Errorf("Failed to load container %v: %v", id, err)
... ...
@@ -306,7 +308,7 @@ func (daemon *Daemon) restore() error {
306 306
 	group.Wait()
307 307
 
308 308
 	if !debug {
309
-		if logrus.GetLevel() == logrus.InfoLevel {
309
+		if logrus.GetLevel() == logrus.InfoLevel && containerCount > 0 {
310 310
 			fmt.Println()
311 311
 		}
312 312
 		logrus.Info("Loading containers: done.")