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>
Upstream-commit: 478dd721ab7aca37264897b664dfa2ec953d7048
Component: engine
This commit is contained in:
Doug Davis
2016-06-26 10:51:34 -07:00
parent d43d3ef209
commit 0d19acd851
+3 -1
View File
@@ -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.")