Uploaded image for project: 'Puppet Task Runner'
  1. Puppet Task Runner
  2. BOLT-1337

Make .filter_set called on a ResultSet return a ResultSet

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: BOLT 1.21.0
    • Component/s: None
    • Template:
    • Sprint:
      Bolt Kanban
    • Release Notes:
      Enhancement
    • Release Notes Summary:
      A {{filter_set}} function has been added to the {{ResultSet}} data type which filters a {{ResultSet}} with a lambda to return a {{ResultSet}} object.
    • QA Risk Assessment:
      Needs Assessment

      Description

      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 a new method, .filter_set, which when called on a ResultSet returns a ResultSet. Making a new method instead of just fixing .filter because of concerns over breaking / backwards incompatible changes.

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                lucy Lucy Wyman
                Reporter:
                reid Reid Vandewiele
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support