Skip to content

Commit 7c1d093

Browse files
authored
Merge pull request #275 from rwaffen/update_outputs
fix: return only arrays with names(strings) instead of TargetSpecs/ResultSpecs
2 parents f3ab1d8 + 4874527 commit 7c1d093

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

plans/patch_batch.pp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
# get nodes that are 'clean' from health check results
5858
$nodes_to_patch = ($health_checks.filter_set |$item| { $item.value['state'] == 'clean' }).map |$n| { $n.target }
59-
$health_check_failed = ($health_checks.filter_set |$item| { $item.status == 'failure' }).map |$n| { $n.target }
59+
$health_check_failed = ($health_checks.filter_set |$item| { $item.status == 'failure' }).map |$n| { $n.name }.sort
6060

6161
if $debug {
6262
out::message('patch_batch.pp: Nodes to patch after health check:')
@@ -87,20 +87,20 @@
8787

8888
$no_patches = $patching_result.ok_set.filter |$item| {
8989
$item.value['packages_updated'].empty
90-
}.map |$n| { $n.target }
90+
}.map |$n| { $n.name }.sort
9191

9292
$with_patches = $patching_result.ok_set.filter |$item| {
9393
! $item.value['packages_updated'].empty
94-
}.map |$n| { $n.target }
94+
}.map |$n| { $n.name }.sort
9595

9696
$reboot_required = $patching_result.ok_set.filter |$item| {
9797
$item.value['reboot_required'] == true
98-
}.map |$n| { $n.target }
98+
}.map |$n| { $n.name }.sort
9999

100100
$targets = get_targets($batch).map |$t| { $t.name }.sort
101101

102102
$output = {
103-
failed => $patching_result.error_set.names,
103+
failed => $patching_result.error_set.map |$n| { $n.name }.sort,
104104
health_check => $run_health_check,
105105
health_check_failed => $health_check_failed,
106106
no_patches => $no_patches,

0 commit comments

Comments
 (0)