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

Hiera 5: strange error unless path is defined

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 4.9.0
    • Fix Version/s: PUP 4.10.0
    • Component/s: None
    • Labels:
    • Environment:
    • Template:
    • Epic Link:
    • Team:
      Puppet Developer Experience
    • Story Points:
      1
    • Sprint:
      PDE 2017-03-08, PDE 2017-03-22
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      When a hiera 5 hiera.yaml contained an entry for a data_hash function where none of the options that results in a path was defined, it would produce a correct but baffling error message "the options hash must have one entry (and it had 0)". Now, the error message is informative and points out the actual problem.
      Show
      When a hiera 5 hiera.yaml contained an entry for a data_hash function where none of the options that results in a path was defined, it would produce a correct but baffling error message "the options hash must have one entry (and it had 0)". Now, the error message is informative and points out the actual problem.
    • QA Risk Assessment:
      No Action
    • QA Risk Assessment Reason:
      covered by unit tests

      Description

      Potential bug filed as requested by Henrik Lindberg on slack.

      Please consider following snippet:

      ---
      version: 5
       
      defaults:
        datadir: hieradata
        data_hash: yaml_data
       
      hierarchy:
        - name: 'Nodes'
          data_hash: yaml_data
          path: "nodes/%{::trusted.certname}"
       
        - name: 'Common'
          data_hash: yaml_data
          path: common.yaml
      

      Unless "data_hash: yaml_data" is provided for each level I get the following error:

      Error while evaluating a Function Call, 'yaml_data' parameter 'options' expects size to be 1, got 0
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                Arioch Tom De Vylder
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support