Jira (BOLT-1337) Make .filter called on a ResultSet return a ResultSet

7 views
Skip to first unread message

Reid Vandewiele (JIRA)

unread,
May 23, 2019, 10:35:03 AM5/23/19
to puppe...@googlegroups.com
Reid Vandewiele created an issue
 
Puppet Task Runner / Improvement BOLT-1337
Make .filter called on a ResultSet return a ResultSet
Issue Type: Improvement Improvement
Assignee: Unassigned
Created: 2019/05/23 7:34 AM
Priority: Normal Normal
Reporter: Reid Vandewiele

This should work. It doesn’t, because filter called on a ResultSet returns an array.

# Identify those nodes that need to be rebooted.
$reboot_targets = $patch_results.ok_set.filter |$result| {
  $result['reboot_flag'] == true
}.targets

Make .filter called on a ResultSet return a ResultSet.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Alex Dreyer (JIRA)

unread,
May 28, 2019, 12:55:02 PM5/28/19
to puppe...@googlegroups.com

Reid Vandewiele (JIRA)

unread,
May 28, 2019, 6:51:03 PM5/28/19
to puppe...@googlegroups.com
Reid Vandewiele updated an issue
Change By: Reid Vandewiele
This should work. It doesn’t, because filter called on a ResultSet returns an array.

{code}

# Identify those nodes that need to be rebooted.
$reboot_targets = $patch_results.ok_set.filter |$result| {
  $result['reboot_flag'] == true
}.targets
{code}

Make
a new method, {{. filter filter_set }} , which when called on a ResultSet return returns a ResultSet. Making a new method instead of just fixing {{.filter}} because of concerns over breaking / backwards incompatible changes.
Reply all
Reply to author
Forward
0 new messages