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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 4.4.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Epic Link:
    • Story Points:
      1
    • Sprint:
      Language 2016-02-10, Language 2016-02-24
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      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

              jsd-sla-details-panel

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Zendesk Support