|
38 | 38 |
|
39 | 39 | # produce titles and headers for tables
|
40 | 40 | $table_title = "Overall Status: ${overall_status}"
|
41 |
| - $table_head = ['Stack', 'Status'] |
42 |
| - $service_table_head = ['Stack', 'Service', 'Url', 'Status'] |
| 41 | + $table_head = ['Cluster', 'Status'] |
| 42 | + $service_table_head = ['Cluster', 'Service', 'Url', 'Status'] |
43 | 43 |
|
44 | 44 | $stack_table_rows = $stack_status.map | $item | { [$item[0], $item[1][status]] }
|
45 | 45 | $passed_table_rows = $overall_passed_stacks.map | $item | { [$item[0], $item[1][status]] }
|
|
60 | 60 |
|
61 | 61 | # print to table via out::message or return json output
|
62 | 62 | if $format == 'table' {
|
63 |
| - $summary_table = format::table({title => $table_title, |
64 |
| - head => $table_head, |
65 |
| - rows => $stack_table_rows, |
66 |
| - style => {width => 80} |
67 |
| - }) |
68 |
| - out::message($summary_table) |
| 63 | + # Summary table |
| 64 | + out::message( |
| 65 | + format::table({ |
| 66 | + title => $table_title, |
| 67 | + head => $table_head, |
| 68 | + rows => $stack_table_rows})) |
| 69 | + |
| 70 | + # Failed services table |
69 | 71 | unless $bad_svc_rows.empty {
|
70 |
| - $failed_table = format::table({title => 'Failed Service Status', |
71 |
| - head => $service_table_head, |
72 |
| - rows => $bad_svc_rows[0] |
73 |
| - }) |
74 |
| - out::message($failed_table) |
| 72 | + out::message( |
| 73 | + format::table({ |
| 74 | + title => 'Failed Service Status', |
| 75 | + head => $service_table_head, |
| 76 | + rows => $bad_svc_rows.reduce([]) |$memo,$rows| { $memo + $rows }})) |
75 | 77 | }
|
76 | 78 |
|
| 79 | + # Operational services table |
77 | 80 | if $verbose and ! $good_svc_rows.empty {
|
78 |
| - $passed_table = format::table({title => 'Operational Service Status', |
79 |
| - head => $service_table_head, |
80 |
| - rows => $good_svc_rows[0] |
81 |
| - }) |
82 |
| - out::message($passed_table) |
| 81 | + out::message( |
| 82 | + format::table({ |
| 83 | + title => 'Operational Service Status', |
| 84 | + head => $service_table_head, |
| 85 | + rows => $good_svc_rows.reduce([]) |$memo,$rows| { $memo + $rows }})) |
83 | 86 | }
|
84 | 87 | } else {
|
85 | 88 | if $summarize {
|
|
0 commit comments