Skip to content

Commit 47b94c5

Browse files
committed
Fix #110 - peadm::status plan fails with new bolt version
* previously when getting data after a task is run, we fetched the result data. However, a newer version of bolt changed the key name to value and broke this code. This fixes that by fetching the newer key name and failing back to the old key name if the value does not exist.
1 parent 4457aac commit 47b94c5

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

plans/status.pp

+5-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
) {
1717
$results = run_task('peadm::infrastatus', $targets, { format => 'json'})
1818
# returns the data in a hash
19-
$stack_status = $results.to_data.reduce({}) | $res, $item | {
20-
$data = $item[result][output] # parsed output of each target
21-
$res.merge({ $item[target] => peadm::determine_status($data, $colors).merge(stack_name => $item[target] ) })
19+
$stack_status = $results.reduce({}) | $res, $item | {
20+
$data = $item.value[output]
21+
$stack_name = $item.target.name
22+
$status = peadm::determine_status($data, $colors).merge(stack_name => $stack_name )
23+
$res.merge({ $stack_name => $status })
2224
}
2325

2426
$overall_degraded_stacks = $stack_status.filter | $item | { $item[1][status] =~ /degraded/ }
File renamed without changes.

0 commit comments

Comments
 (0)