Merge pull request #2219 from allencloud/hide-field-error-when-empty

hide error in info when empty
This commit is contained in:
Xian Chaobo 2016-05-10 20:30:46 +08:00
commit 765a16274f
1 changed files with 2 additions and 3 deletions

View File

@ -871,10 +871,9 @@ func (c *Cluster) Info() [][2]string {
sort.Strings(labels)
info = append(info, [2]string{" └ Labels", fmt.Sprintf("%s", strings.Join(labels, ", "))})
errMsg := engine.ErrMsg()
if len(errMsg) == 0 {
errMsg = "(none)"
if len(errMsg) != 0 {
info = append(info, [2]string{" └ Error", errMsg})
}
info = append(info, [2]string{" └ Error", errMsg})
info = append(info, [2]string{" └ UpdatedAt", engine.UpdatedAt().UTC().Format(time.RFC3339)})
info = append(info, [2]string{" └ ServerVersion", engine.Version})
}