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

    • Task
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • PUP 6.22.0
    • None
    • Night's Watch
    • 2
    • NW - 2021-04-14
    • Enhancement
    • 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.
    • 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

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

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support