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

lookups within hiera data values break %{literal('%')}

    XMLWordPrintable

    Details

    • Template:
    • Acceptance Criteria:
      Hide


      some_text: "%

      {alias('label_format')}

      "
      label_format: "%

      {literal('%')}{vpc}_pub%{literal('%')} {az}"

      lookup('some_text', Data, 'first', '') should return the literal text "%{vpc}_pub%{az}

      " without any value substitution.

      Show
      — some_text: "% {alias('label_format')} " label_format: "% {literal('%')}{vpc}_pub%{literal('%')} {az}" lookup('some_text', Data, 'first', '') should return the literal text "%{vpc}_pub%{az} " without any value substitution.
    • Team:
      Puppet Developer Experience
    • Story Points:
      2
    • Sprint:
      PDE 2017-05-31
    • CS Priority:
      Major
    • CS Frequency:
      4 - 50-90% of Customers
    • CS Severity:
      2 - Annoyance
    • CS Business Value:
      1 - ?
    • CS Impact:
      Hide
      The need for this is to enable storing ruby string format specifiers in the hiera data that are used within our custom types for generating labels and names for resources that are generated in line with a customer defined naming convention

      The work around is for us to create our own mark up format, and then translate into the ruby specification format within the custom provider
      Show
      The need for this is to enable storing ruby string format specifiers in the hiera data that are used within our custom types for generating labels and names for resources that are generated in line with a customer defined naming convention The work around is for us to create our own mark up format, and then translate into the ruby specification format within the custom provider
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      In hiera data, if aliasing a key and the value for that key contained escaped interpolations those escaped interpolations would be taken as interpolations instead of keeping the aliased value intact. This is now fixed.
    • QA Risk Assessment:
      Manual
    • QA Risk Assessment Reason:
      covered by unit tests; edge case

      Description

      consider the hiera data fragment:

      ---
      some_text: "%{alias('label_format')}"
      label_format: "%{literal('%')}{vpc}_pub%{literal('%')}{az}"
      


      When you lookup the value 'label_format' you correctly obtain the string

      "%{vpc}_pub%{az}"
      

      as the value. However, if you lookup the value 'some_text' then the result depends on whether

      %{vpc}
      

      and

      %{az}
      

      have valid substitutions. Without facts or variables, the current result from the lookup is the string "_pub"

      Until this bug is fixed, the utility of the %

      {literal('%')}

      function is limited to being used in values that are only directly requested.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            micptolshaw Michael Shaw
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support