Skip to content

Commit ba29c16

Browse files
committed
Update status plan for readability, bugs
1 parent c6af898 commit ba29c16

File tree

5 files changed

+124
-73
lines changed

5 files changed

+124
-73
lines changed

plans/status.pp

+21-18
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838

3939
# produce titles and headers for tables
4040
$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']
4343

4444
$stack_table_rows = $stack_status.map | $item | { [$item[0], $item[1][status]] }
4545
$passed_table_rows = $overall_passed_stacks.map | $item | { [$item[0], $item[1][status]] }
@@ -60,26 +60,29 @@
6060

6161
# print to table via out::message or return json output
6262
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
6971
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 }}))
7577
}
7678

79+
# Operational services table
7780
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 }}))
8386
}
8487
} else {
8588
if $summarize {

spec/fixtures/plans/failed_table.txt

+30-12
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
1-
+-----------+------------------+--------------------------+--------+
2-
| Failed Service Status |
3-
+-----------+------------------+--------------------------+--------+
4-
| Stack | Service | Url | Status |
5-
+-----------+------------------+--------------------------+--------+
6-
| pnw_stack | file-sync-client | pe-std-replica.puppet.vm | failed |
7-
| pnw_stack | master | pe-std-replica.puppet.vm | failed |
8-
| pnw_stack | classifier | pe-std-replica.puppet.vm | failed |
9-
| pnw_stack | rbac | pe-std-replica.puppet.vm | failed |
10-
| pnw_stack | activity | pe-std-replica.puppet.vm | failed |
11-
| pnw_stack | puppetdb | pe-std-replica.puppet.vm | failed |
12-
+-----------+------------------+--------------------------+--------+
1+
+-----------------+------------------+--------------------------+--------+
2+
| Failed Service Status |
3+
+-----------------+------------------+--------------------------+--------+
4+
| Cluster | Service | Url | Status |
5+
+-----------------+------------------+--------------------------+--------+
6+
| pnw_stack | file-sync-client | pe-std-replica.puppet.vm | failed |
7+
| pnw_stack | master | pe-std-replica.puppet.vm | failed |
8+
| pnw_stack | classifier | pe-std-replica.puppet.vm | failed |
9+
| pnw_stack | rbac | pe-std-replica.puppet.vm | failed |
10+
| pnw_stack | activity | pe-std-replica.puppet.vm | failed |
11+
| pnw_stack | puppetdb | pe-std-replica.puppet.vm | failed |
12+
| east_stack | file-sync-client | pe-std-replica.puppet.vm | failed |
13+
| east_stack | master | pe-std-replica.puppet.vm | failed |
14+
| east_stack | classifier | pe-std-replica.puppet.vm | failed |
15+
| east_stack | rbac | pe-std-replica.puppet.vm | failed |
16+
| east_stack | activity | pe-std-replica.puppet.vm | failed |
17+
| east_stack | puppetdb | pe-std-replica.puppet.vm | failed |
18+
| west_stack | file-sync-client | pe-std-replica.puppet.vm | failed |
19+
| west_stack | master | pe-std-replica.puppet.vm | failed |
20+
| west_stack | classifier | pe-std-replica.puppet.vm | failed |
21+
| west_stack | rbac | pe-std-replica.puppet.vm | failed |
22+
| west_stack | activity | pe-std-replica.puppet.vm | failed |
23+
| west_stack | puppetdb | pe-std-replica.puppet.vm | failed |
24+
| northeast_stack | file-sync-client | pe-std-replica.puppet.vm | failed |
25+
| northeast_stack | master | pe-std-replica.puppet.vm | failed |
26+
| northeast_stack | classifier | pe-std-replica.puppet.vm | failed |
27+
| northeast_stack | rbac | pe-std-replica.puppet.vm | failed |
28+
| northeast_stack | activity | pe-std-replica.puppet.vm | failed |
29+
| northeast_stack | puppetdb | pe-std-replica.puppet.vm | failed |
30+
+-----------------+------------------+--------------------------+--------+

spec/fixtures/plans/passed_table.txt

+46-16
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,46 @@
1-
+-----------+---------------------------+------------------+-------------+
2-
| Operational Service Status |
3-
+-----------+---------------------------+------------------+-------------+
4-
| Stack | Service | Url | Status |
5-
+-----------+---------------------------+------------------+-------------+
6-
| pnw_stack | code-manager-service | pe-std.puppet.vm | operational |
7-
| pnw_stack | file-sync-storage-service | pe-std.puppet.vm | operational |
8-
| pnw_stack | file-sync-client-service | pe-std.puppet.vm | operational |
9-
| pnw_stack | pe-master | pe-std.puppet.vm | operational |
10-
| pnw_stack | classifier-service | pe-std.puppet.vm | operational |
11-
| pnw_stack | rbac-service | pe-std.puppet.vm | operational |
12-
| pnw_stack | activity-service | pe-std.puppet.vm | operational |
13-
| pnw_stack | orchestrator-service | pe-std.puppet.vm | operational |
14-
| pnw_stack | broker-service | pe-std.puppet.vm | operational |
15-
| pnw_stack | puppetdb-status | pe-std.puppet.vm | operational |
16-
+-----------+---------------------------+------------------+-------------+
1+
+-----------------+---------------------------+------------------+-------------+
2+
| Operational Service Status |
3+
+-----------------+---------------------------+------------------+-------------+
4+
| Cluster | Service | Url | Status |
5+
+-----------------+---------------------------+------------------+-------------+
6+
| pnw_stack | code-manager-service | pe-std.puppet.vm | operational |
7+
| pnw_stack | file-sync-storage-service | pe-std.puppet.vm | operational |
8+
| pnw_stack | file-sync-client-service | pe-std.puppet.vm | operational |
9+
| pnw_stack | pe-master | pe-std.puppet.vm | operational |
10+
| pnw_stack | classifier-service | pe-std.puppet.vm | operational |
11+
| pnw_stack | rbac-service | pe-std.puppet.vm | operational |
12+
| pnw_stack | activity-service | pe-std.puppet.vm | operational |
13+
| pnw_stack | orchestrator-service | pe-std.puppet.vm | operational |
14+
| pnw_stack | broker-service | pe-std.puppet.vm | operational |
15+
| pnw_stack | puppetdb-status | pe-std.puppet.vm | operational |
16+
| east_stack | code-manager-service | pe-std.puppet.vm | operational |
17+
| east_stack | file-sync-storage-service | pe-std.puppet.vm | operational |
18+
| east_stack | file-sync-client-service | pe-std.puppet.vm | operational |
19+
| east_stack | pe-master | pe-std.puppet.vm | operational |
20+
| east_stack | classifier-service | pe-std.puppet.vm | operational |
21+
| east_stack | rbac-service | pe-std.puppet.vm | operational |
22+
| east_stack | activity-service | pe-std.puppet.vm | operational |
23+
| east_stack | orchestrator-service | pe-std.puppet.vm | operational |
24+
| east_stack | broker-service | pe-std.puppet.vm | operational |
25+
| east_stack | puppetdb-status | pe-std.puppet.vm | operational |
26+
| west_stack | code-manager-service | pe-std.puppet.vm | operational |
27+
| west_stack | file-sync-storage-service | pe-std.puppet.vm | operational |
28+
| west_stack | file-sync-client-service | pe-std.puppet.vm | operational |
29+
| west_stack | pe-master | pe-std.puppet.vm | operational |
30+
| west_stack | classifier-service | pe-std.puppet.vm | operational |
31+
| west_stack | rbac-service | pe-std.puppet.vm | operational |
32+
| west_stack | activity-service | pe-std.puppet.vm | operational |
33+
| west_stack | orchestrator-service | pe-std.puppet.vm | operational |
34+
| west_stack | broker-service | pe-std.puppet.vm | operational |
35+
| west_stack | puppetdb-status | pe-std.puppet.vm | operational |
36+
| northeast_stack | code-manager-service | pe-std.puppet.vm | operational |
37+
| northeast_stack | file-sync-storage-service | pe-std.puppet.vm | operational |
38+
| northeast_stack | file-sync-client-service | pe-std.puppet.vm | operational |
39+
| northeast_stack | pe-master | pe-std.puppet.vm | operational |
40+
| northeast_stack | classifier-service | pe-std.puppet.vm | operational |
41+
| northeast_stack | rbac-service | pe-std.puppet.vm | operational |
42+
| northeast_stack | activity-service | pe-std.puppet.vm | operational |
43+
| northeast_stack | orchestrator-service | pe-std.puppet.vm | operational |
44+
| northeast_stack | broker-service | pe-std.puppet.vm | operational |
45+
| northeast_stack | puppetdb-status | pe-std.puppet.vm | operational |
46+
+-----------------+---------------------------+------------------+-------------+

spec/fixtures/plans/summarized.json

+17-17
Original file line numberDiff line numberDiff line change
@@ -10,102 +10,102 @@
1010
},
1111
"failed": [
1212
{
13-
"Stack": "pnw_stack",
13+
"Cluster": "pnw_stack",
1414
"Service": "file-sync-client",
1515
"Url": "pe-std-replica.puppet.vm",
1616
"Status": "failed"
1717
},
1818
{
19-
"Stack": "pnw_stack",
19+
"Cluster": "pnw_stack",
2020
"Service": "master",
2121
"Url": "pe-std-replica.puppet.vm",
2222
"Status": "failed"
2323
},
2424
{
25-
"Stack": "pnw_stack",
25+
"Cluster": "pnw_stack",
2626
"Service": "classifier",
2727
"Url": "pe-std-replica.puppet.vm",
2828
"Status": "failed"
2929
},
3030
{
31-
"Stack": "pnw_stack",
31+
"Cluster": "pnw_stack",
3232
"Service": "rbac",
3333
"Url": "pe-std-replica.puppet.vm",
3434
"Status": "failed"
3535
},
3636
{
37-
"Stack": "pnw_stack",
37+
"Cluster": "pnw_stack",
3838
"Service": "activity",
3939
"Url": "pe-std-replica.puppet.vm",
4040
"Status": "failed"
4141
},
4242
{
43-
"Stack": "pnw_stack",
43+
"Cluster": "pnw_stack",
4444
"Service": "puppetdb",
4545
"Url": "pe-std-replica.puppet.vm",
4646
"Status": "failed"
4747
}
4848
],
4949
"operational": [
5050
{
51-
"Stack": "pnw_stack",
51+
"Cluster": "pnw_stack",
5252
"Service": "code-manager-service",
5353
"Url": "pe-std.puppet.vm",
5454
"Status": "operational"
5555
},
5656
{
57-
"Stack": "pnw_stack",
57+
"Cluster": "pnw_stack",
5858
"Service": "file-sync-storage-service",
5959
"Url": "pe-std.puppet.vm",
6060
"Status": "operational"
6161
},
6262
{
63-
"Stack": "pnw_stack",
63+
"Cluster": "pnw_stack",
6464
"Service": "file-sync-client-service",
6565
"Url": "pe-std.puppet.vm",
6666
"Status": "operational"
6767
},
6868
{
69-
"Stack": "pnw_stack",
69+
"Cluster": "pnw_stack",
7070
"Service": "pe-master",
7171
"Url": "pe-std.puppet.vm",
7272
"Status": "operational"
7373
},
7474
{
75-
"Stack": "pnw_stack",
75+
"Cluster": "pnw_stack",
7676
"Service": "classifier-service",
7777
"Url": "pe-std.puppet.vm",
7878
"Status": "operational"
7979
},
8080
{
81-
"Stack": "pnw_stack",
81+
"Cluster": "pnw_stack",
8282
"Service": "rbac-service",
8383
"Url": "pe-std.puppet.vm",
8484
"Status": "operational"
8585
},
8686
{
87-
"Stack": "pnw_stack",
87+
"Cluster": "pnw_stack",
8888
"Service": "activity-service",
8989
"Url": "pe-std.puppet.vm",
9090
"Status": "operational"
9191
},
9292
{
93-
"Stack": "pnw_stack",
93+
"Cluster": "pnw_stack",
9494
"Service": "orchestrator-service",
9595
"Url": "pe-std.puppet.vm",
9696
"Status": "operational"
9797
},
9898
{
99-
"Stack": "pnw_stack",
99+
"Cluster": "pnw_stack",
100100
"Service": "broker-service",
101101
"Url": "pe-std.puppet.vm",
102102
"Status": "operational"
103103
},
104104
{
105-
"Stack": "pnw_stack",
105+
"Cluster": "pnw_stack",
106106
"Service": "puppetdb-status",
107107
"Url": "pe-std.puppet.vm",
108108
"Status": "operational"
109109
}
110110
]
111-
}
111+
}

spec/fixtures/plans/summary_table.txt

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
+---------------------------------------+--------------------------------------+
2-
| Overall Status: degraded |
3-
+---------------------------------------+--------------------------------------+
4-
| Stack | Status |
5-
+---------------------------------------+--------------------------------------+
6-
| pnw_stack | degraded |
7-
| east_stack | degraded |
8-
| west_stack | degraded |
9-
| northeast_stack | degraded |
10-
+---------------------------------------+--------------------------------------+
1+
+-----------------+----------+
2+
| Overall Status: degraded |
3+
+-----------------+----------+
4+
| Cluster | Status |
5+
+-----------------+----------+
6+
| pnw_stack | degraded |
7+
| east_stack | degraded |
8+
| west_stack | degraded |
9+
| northeast_stack | degraded |
10+
+-----------------+----------+

0 commit comments

Comments
 (0)