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

hiera('some::key', undef) returns empty string

    XMLWordPrintable

Details

    • 2
    • Language 2015-02-04, Language 2015-02-18, Language 2015-04-01, Language 2015-04-15
    • Bug Fix

    Description

      When using the hiera() function with a second parameter of undef, Hiera returns the empty string for the value. When using Puppet 3.7 future parser, this means that Hiera returns a truthy value when it cannot find a key.

      In the Puppet 3 language, this doesn't matter because '' == undef evaluates to true.

      A workaround for this is to specify a second parameter of false instead of undef, but that doesn't make this behavior any less confusing.

      Final resolution: In the Puppet 4 language, the hiera functions will now respect and return a default of undef, same as they do in the Puppet 3 language. (in comment)

      risk assessment: high
      probability: high (regression)
      severity: medium (can work around in puppet code, but it's not-expected)
      highest test layer: acceptance
      FR only for now (acceptance is ticketed in a larger test for all functions) PUP-4342

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lexa Lexa Whitehurst
              Eric Thompson Eric Thompson
              Votes:
              1 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support