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

`puppet facts diff` output should be pretty

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • PUP 6.22.0
    • None
    • Night's Watch
    • 1
    • NW - 2021-04-14
    • Enhancement
    • The "puppet facts diff" command now pretty prints its JSON output. The older form can be specified using "--render_as json".
    • Needs Assessment

    Description

      The Problem

      The output of `puppet facts diff` is all smashed on one line instead of being human readable.

      [root@master20198-latest-centos ~]# puppet facts diff
      {"foo.bar":{"new_value":null,"old_value":"true"},"pe_postgresql_info.data_partition_available_bytes":{"new_value":59176595456,"old_value":59176505344},"platform_tag":{"new_value":"centos-7-x86_64","old_value":"el-7-x86_64"},"puppet_inventory_metadata.packages.last_collection_time":{"new_value":"0.4702s","old_value":"0.588s"}}
      

      I have to run it through another tool like python or jq to effectively read the output

      [root@master20198-latest-centos ~]# puppet facts diff | python -m json.tool
      {
          "foo.bar": {
              "new_value": null,
              "old_value": "true"
          },
          "pe_postgresql_info.data_partition_available_bytes": {
              "new_value": 59173752832,
              "old_value": 59173863424
          },
          "platform_tag": {
              "new_value": "centos-7-x86_64",
              "old_value": "el-7-x86_64"
          },
          "puppet_inventory_metadata.packages.last_collection_time": {
              "new_value": "0.463s",
              "old_value": "0.5941s"
          }
      }
      

      Suggested solution

      We should print the output in a human readable format.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support