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

`puppet facts diff` does not output facts that only exist in Facter 4

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 6.22.0
    • Component/s: None
    • Labels:
    • Template:
    • Team:
      Night's Watch
    • Story Points:
      2
    • Sprint:
      NW - 2021-04-14
    • Release Notes:
      Enhancement
    • Release Notes Summary:
      Hide
      The `puppet facts diff` CLI command was improved by showing all differences between Facter 3 and Facter 4 (including facts available only in Facter 4), sorting output results in alphabetical order for better human readability, allowing users to remove certain facts from output (via the `--exclude <regex>` CLI option) and including a CLI option to see results in a fully structured form.
      Show
      The `puppet facts diff` CLI command was improved by showing all differences between Facter 3 and Facter 4 (including facts available only in Facter 4), sorting output results in alphabetical order for better human readability, allowing users to remove certain facts from output (via the `--exclude <regex>` CLI option) and including a CLI option to see results in a fully structured form.
    • QA Risk Assessment:
      Needs Assessment

      Description

      The Problem

      Given the following facts

      Given the following facts:
       
      cat /opt/puppetlabs/facter/facts.d/foo.bar.txt
      foo.bar=true
      cat /opt/puppetlabs/facter/facts.d/c.d.json
      {
        "c.d":
        {
          "foo": 4
        }
      }
      cat /opt/puppetlabs/facter/facts.d/bar.json
      {
        "bar":
        {
          "e.f": 5
        }
      }
      cat /opt/puppetlabs/facter/facts.d/a.b.txt
      a.b=3
      

      you'll get output from `puppet facts diff` like this:

      [root@master20198-latest-centos ~]# puppet facts diff | python -m json.tool
      {
          "a.b": {
              "new_value": null,
              "old_value": "3"
          },
          "c.d.foo": {
              "new_value": null,
              "old_value": 4
          },
          "foo.bar": {
              "new_value": null,
              "old_value": "true"
          },
      ...
      }
      

      which does not show that there are new facts "a", "c" and "foo" in Facter 4.

      Suggested Solution

      ideally we show these new facts with the new_value set and the old_value as null.

        Attachments

          Activity

            People

            Assignee:
            luchian.nemes Luchian Nemes
            Reporter:
            nick.walker Nick Walker
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support