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

lookup explain shows found data incorrectly

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 4.7.0
    • Fix Version/s: PUP 4.9.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Team:
      Puppet Developer Experience
    • Story Points:
      1
    • Sprint:
      PDS 2016-11-16, PDS 2016-11-30
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      The puppet lookup --explain would sometimes not correctly show looked up values when doing deep merges.

      Description

      # data/nodes/dev3.devco.net.yaml
      users::local:
        rip:
          email: "arri.pienaar@example.net"
      

      # data/common.yaml
      users::local:
        rip:
          email: "rip@devco.net"
          comment: "R.I.Pienaar"
          sudoer: true
          shell: "/bin/zsh"
      

      When I run explain with a hash merge above I see the following:

      $ puppet lookup --environmentpath `pwd` users::local --merge deep --explain
      Merge strategy deep
        Options: {
          "sort_merge_arrays" => false,
          "merge_hash_arrays" => false
        }
        Data Binding "hiera"
          No such key: "users::local"
        Data Provider "Hiera Data Provider, version 4"
          ConfigurationPath "/home/rip/temp/preso/environments/production/hiera.yaml"
          Merge strategy deep
            Options: {
              "sort_merge_arrays" => false,
              "merge_hash_arrays" => false
            }
            Interpolation on "nodes/%{trusted.certname}"
              Global Scope
                Found key: "trusted" value: {
                  "authenticated" => "local",
                  "certname" => "dev3.devco.net",
                  "extensions" => {},
                  "hostname" => "dev3",
                  "domain" => "devco.net"
                }
              Sub key: "certname"
                Found key: "certname" value: "dev3.devco.net"
            Data Provider "Nodes"
              Path "/home/rip/temp/preso/environments/production/data/nodes/dev3.devco.net.yaml"
                Original path: "nodes/%{trusted.certname}"
                Found key: "users::local" value: {
                  "rip" => {
                    "email" => "arri.pienaar@example.net"
                  }
                }
            Data Provider "common"
              Path "/home/rip/temp/preso/environments/production/data/common.yaml"
                Original path: "common"
                Found key: "users::local" value: {
                  "rip" => {
                    "email" => "arri.pienaar@example.net",
                    "comment" => "R.I.Pienaar",
                    "sudoer" => true,
                    "shell" => "/bin/zsh"
                  }
                }
            Merged result: {
              "rip" => {
                "email" => "arri.pienaar@example.net",
                "comment" => "R.I.Pienaar",
                "sudoer" => true,
                "shell" => "/bin/zsh"
              }
            }
        Module "users"
          Module not found
        Merged result: {
          "rip" => {
            "email" => "arri.pienaar@example.net",
            "comment" => "R.I.Pienaar",
            "sudoer" => true,
            "shell" => "/bin/zsh"
          }
        }
      

      The end result is correct, but note the following:

            Data Provider "common"
              Path "/home/rip/temp/preso/environments/production/data/common.yaml"
                Original path: "common"
                Found key: "users::local" value: {
                  "rip" => {
                    "email" => "arri.pienaar@example.net",
                    "comment" => "R.I.Pienaar",
                    "sudoer" => true,
                    "shell" => "/bin/zsh"
                  }
                }
            Merged result: {
              "rip" => {
                "email" => "arri.pienaar@example.net",
                "comment" => "R.I.Pienaar",
                "sudoer" => true,
                "shell" => "/bin/zsh"
              }
            }
      

      I would expect the Found key: "users::local" value to show email rip@devco.net and the Merged Result to show arri.pienaar@example.net

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ripienaar R.I.Pienaar
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support