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

Lookup should parse dot in key consistently throughout

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 4.5.0
    • Component/s: Docs
    • Labels:
      None
    • Template:
    • Acceptance Criteria:
      Hide

      That the lookup CLI application and lookup function works the same way wrt: "dotted access" as in hiera.

      • use of dotted access "drills down" into data e.g. lookup('key.subkey.0')
      • verbatim lookup is possible by quoting part of key e.g. lookup('key."a.b.c".0')
      • interpolation is possible using hiera syntax and semantic - thus making it possible to use a hiera data file without change
      Show
      That the lookup CLI application and lookup function works the same way wrt: "dotted access" as in hiera. use of dotted access "drills down" into data e.g. lookup('key.subkey.0') verbatim lookup is possible by quoting part of key e.g. lookup('key."a.b.c".0') interpolation is possible using hiera syntax and semantic - thus making it possible to use a hiera data file without change
    • Epic Link:
    • Story Points:
      1
    • Sprint:
      Language 2016-04-20
    • Release Notes:
      New Feature
    • Release Notes Summary:
      Hide
      The lookup CLI tool and lookup function now handles lookup of keys with a '.' (dot) as a sub-lookup. Earlier dots in keys were used verbatim. After this change it is required to quote the key (or part of the key) to get verbatim lookup of a key containing dots. It is now also possible to have hiera style interpolation in data - thus making hiera 3.x data files fully compatible with the new "data in environments and modules" implementation.
      Show
      The lookup CLI tool and lookup function now handles lookup of keys with a '.' (dot) as a sub-lookup. Earlier dots in keys were used verbatim. After this change it is required to quote the key (or part of the key) to get verbatim lookup of a key containing dots. It is now also possible to have hiera style interpolation in data - thus making hiera 3.x data files fully compatible with the new "data in environments and modules" implementation.
    • QA Risk Assessment:
      No Action
    • QA Risk Assessment Reason:
      covered by unit tests

      Description

      Lookup and Hiera treats dotted keys differently. While hiera will recognize them everywhere (except when they are quoted), the Puppet lookup will only recognized them within interpolations that in turn, are only recognized by the Hiera Data Provider. For the sake of consistency, lookup should instead do what Hiera does.

      This means that:

      • the command line lookup should be made consistent with hiera and facter tools as they take unquoted input as sub-lookup, and handles quoted input as verbatim.
      • interpolation expressions should be recognized by all data providers, not just the Hiera data provider
      • dotted keys that are not quoted, should be parsed at all times, not just in interpolations

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  john.duarte John Duarte
                  Reporter:
                  henrik.lindberg Henrik Lindberg
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: