address feedback

This commit is contained in:
Alex Dadgar
2016-10-25 11:31:09 -07:00
parent 72ce7e7d41
commit 0553288b07
2 changed files with 5 additions and 3 deletions

View File

@@ -9,8 +9,8 @@ import (
)
var (
// NodeDownErr marks an operational as not able to complete since the node
// is down.
// NodeDownErr marks an operation as not able to complete since the node is
// down.
NodeDownErr = fmt.Errorf("node down")
)

View File

@@ -233,9 +233,11 @@ func (c *AllocStatusCommand) Run(args []string) int {
var stats *api.AllocResourceUsage
stats, statsErr = client.Allocations().Stats(alloc, nil)
if statsErr != nil {
c.Ui.Output("")
if statsErr != api.NodeDownErr {
c.Ui.Output("")
c.Ui.Error(fmt.Sprintf("couldn't retrieve stats (HINT: ensure Client.Advertise.HTTP is set): %v", statsErr))
} else {
c.Ui.Output("Omitting resource statistics since the node is down.")
}
}
c.outputTaskDetails(alloc, stats, displayStats)