Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-7751

Lookup sort_merged_arrays vs. sort_merge_arrays

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 4.10.4, PUP 5.0.0
    • Fix Version/s: PUP 4.10.5, PUP 5.0.1
    • Component/s: Hiera & Lookup
    • Labels:
      None
    • Environment:

      puppet-agent 5.0.0 on Fedora 25

    • Template:
    • Sub-team:
    • Team:
      Agent
    • Story Points:
      1
    • Sprint:
      Agent 2017-07-12
    • Method Found:
      Customer Feedback
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      The hiera option {{sort_merged_arrays}} which is used to get sorted arrays when merging was silently ignored (no sorting took place).
    • QA Risk Assessment:
      Manual

      Description

      When specifying sort_merged_arrays in hiera data as shown here:

      lookup_options:
        classifier::extra_classes:
          merge:
            strategy: deep
            knockout_prefix: --
            sort_merged_arrays: true
        classifier::rules:
          merge:
            strategy: deep
            knockout_prefix: --
      

      the compiler fails:

      Error: Evaluation Error: Error while evaluating a Function Call, The merge options has wrong type, unrecognized key 'sort_merged_arrays' at /home/user/.puppetlabs/etc/code/environments/production/manifests/site.pp:4:3 on node notebook.local
      

      spelling it sort_merge_arrays fixes the problem.

      also this snippet fails:

        lookup({
          'name' => 'classifier::rules',
          'merge' => {
            'strategy' => 'deep',
            'sort_merged_arrays' => true,
           },
        })
      

      output:

      Error: Evaluation Error: Error while evaluating a Function Call, The merge options has wrong type, unrecognized key 'sort_merged_arrays' at /home/user/.puppetlabs/etc/code/environments/production/manifests/site.pp:4:3 on node notebook.local
      

      Grepping the puppet git repo there are different places where sort_merge_arrays and sort_merged_arrays is used.

      sort_merged_arrays is documented here: https://docs.puppet.com/puppet/5.0/hiera_use_function.html

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Raffaello Thomas Mueller
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support