add further driver info; driver name with subsystem

This commit is contained in:
Chelsea Holland Komlo 2018-03-29 13:30:34 -04:00
parent baeadae990
commit 48765d334c
2 changed files with 55 additions and 17 deletions

View File

@ -430,8 +430,8 @@ func (c *NodeStatusCommand) outputNodeEvent(events []*api.NodeEvent) {
for i, event := range events {
timestamp := formatTime(event.Timestamp)
subsystem := event.Subsystem
msg := formatEventMessage(event.Message, event.Details["driver"])
subsystem := formatEventSubsystem(event.Subsystem, event.Details["driver"])
msg := event.Message
if c.verbose {
details := formatEventDetails(event.Details)
nodeEvents[size-i] = fmt.Sprintf("%s|%s|%s|%s", timestamp, subsystem, msg, details)
@ -442,12 +442,14 @@ func (c *NodeStatusCommand) outputNodeEvent(events []*api.NodeEvent) {
c.Ui.Output(formatList(nodeEvents))
}
func formatEventMessage(message, driverName string) string {
func formatEventSubsystem(subsystem, driverName string) string {
if driverName == "" {
return message
return subsystem
}
return fmt.Sprintf("Driver: %s, %s", driverName, message)
// If this event is for a driver, append the driver name to make the message
// clearer
return fmt.Sprintf("Driver: %s", driverName)
}
func formatEventDetails(details map[string]string) string {

View File

@ -99,10 +99,19 @@ Drain = false
Status = ready
Uptime = 17h42m50s
Drivers
Driver Detected Healthy
docker false false
exec true true
java true true
qemu true true
raw_exec true true
rkt true true
Node Events
Time Subsystem Message
2018-03-29T16:14:02Z Driver Driver: docker, Driver docker is not detected
2018-03-29T16:02:02Z Cluster Node Registered
Time Subsystem Message
2018-03-29T17:24:42Z Driver: docker Driver docker is not detected
2018-03-29T17:23:42Z Cluster Node Registered
Allocated Resources
CPU Memory Disk IOPS
@ -133,10 +142,19 @@ Drain = false
Status = ready
Uptime = 17h7m41s
Drivers
Driver Detected Healthy
docker false false
exec true true
java true true
qemu true true
raw_exec true true
rkt true true
Node Events
Time Subsystem Message
2018-03-29T16:14:02Z Driver Driver: docker, Driver docker is not detected
2018-03-29T16:02:02Z Cluster Node Registered
Time Subsystem Message
2018-03-29T17:24:42Z Driver: docker Driver docker is not detected
2018-03-29T17:23:42Z Cluster Node Registered
Allocated Resources
CPU Memory Disk IOPS
@ -189,10 +207,19 @@ Drain = false
Status = ready
Uptime = 17h7m41s
Drivers
Driver Detected Healthy
docker false false
exec true true
java true true
qemu true true
raw_exec true true
rkt true true
Node Events
Time Subsystem Message
2018-03-29T16:14:02Z Driver Driver: docker, Driver docker is not detected
2018-03-29T16:02:02Z Cluster Node Registered
Time Subsystem Message
2018-03-29T17:24:42Z Driver: docker Driver docker is not detected
2018-03-29T17:23:42Z Cluster Node Registered
Allocated Resources
CPU Memory Disk IOPS
@ -261,10 +288,19 @@ Drain = false
Status = ready
Uptime = 17h7m41s
Drivers
Driver Detected Healthy Message Time
docker false false Driver docker is not detected 2018-03-29T17:24:42Z
exec true true <none> 2018-03-29T17:23:42Z
java true true <none> 2018-03-29T17:23:41Z
qemu true true <none> 2018-03-29T17:23:41Z
raw_exec true true <none> 2018-03-29T17:23:42Z
rkt true true <none> 2018-03-29T17:23:42Z
Node Events
Time Subsystem Message Details
2018-03-29T16:27:48Z Driver Driver: docker, Driver docker is not detected <none>
2018-03-29T16:26:48Z Cluster Node Registered <none>
Time Subsystem Message Details
2018-03-29T17:24:42Z Driver: docker Driver docker is not detected driver: docker,
2018-03-29T17:23:42Z Cluster Node Registered <none>
Allocated Resources
CPU Memory Disk IOPS