mirror of
https://github.com/docker/cli.git
synced 2026-10-09 15:35:53 -04: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> Upstream-commit: 478dd721ab7aca37264897b664dfa2ec953d7048 Component: engine
This commit is contained in:
@@ -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.")
|
||||
|
||||
Reference in New Issue
Block a user