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

Interpolation of an empty variable %{} or %{::} should yield an empty string

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • PUP 4.4.0
    • None
    • None
    • 1
    • Language 2016-02-10, Language 2016-02-24
    • Bug Fix
    • Empty interpolations in hiera data e.g. %{}, %%{}, %{::} and similar variations did not produce the correct result of an empty string when such constructs where found in data processed by the lookup function and command line tool.

    Description

      The Hiera data provider should behave the same way as Hiera 3.0 when interpolating an empty string or a string that contains an empty name separator '::'. The interpolated expression should ignore leading and trailing whitespace.

      %{} => ''
      %{  } => ''
      %{::} => ''
      %{ :: } => ''
      

      Leading and trailing whitespace will always be ignored in the Hiera dataprovider. So:

      %{ some key }
      

      will be considered exactly the same as:

      %{some key}
      

      In case that someone really want a leading or tralining space in the key, they can use the syntax:

      %{scope(' some key ')}
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              thomas.hallgren Thomas Hallgren
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support