diff --git a/api/allocations.go b/api/allocations.go index 03a28f806bf..92baad9083f 100644 --- a/api/allocations.go +++ b/api/allocations.go @@ -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") ) diff --git a/command/alloc_status.go b/command/alloc_status.go index ba7e7b292e4..d0c8b09e51b 100644 --- a/command/alloc_status.go +++ b/command/alloc_status.go @@ -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)