Skip to content

Commit 339af86

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 339af86

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plans/status.pp

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@
1515
Boolean $colors = $format ? { json => false, default => true }
1616
) {
1717
$results = run_task('peadm::infrastatus', $targets, { format => 'json'})
18+
1819
# returns the data in a hash
1920
$stack_status = $results.to_data.reduce({}) | $res, $item | {
20-
$data = $item[result][output] # parsed output of each target
21+
# bolt recently changed how it stores the data from the task
22+
# since we must deal with both versions, the fallback is to use the
23+
# old result key
24+
$data = $item.get(value, $item.get(result))[output]
2125
$res.merge({ $item[target] => peadm::determine_status($data, $colors).merge(stack_name => $item[target] ) })
2226
}
2327

0 commit comments

Comments
 (0)