Uploaded image for project: 'Facter'
  1. Facter
  2. FACT-3022

`--json` flag inconsistencies between Facter 3 and Facter 4 when resolving external executable files

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Template:
    • Acceptance Criteria:
      Hide

      --json produces the same output on Facter 3 and Facter 4

      Show
      --json produces the same output on Facter 3 and Facter 4
    • Team:
      Night's Watch
    • Story Points:
      1
    • Sprint:
      NW - 2021-09-22
    • Method Found:
      Needs Assessment
    • Release Notes:
      Not Needed
    • QA Risk Assessment:
      Needs Assessment

      Description

      Running facter cli with `--json` produces different outputs, on Facter 3 and Facter 4, for facts that cannot be resolved when querying for fact names

      # facter 4
      ❯ bx facter non_existent --json
      {
        "non_existent": null
      }
       
      # facter 3
      ❯ cfacter non_existent --json
      {
        "non_existent": ""
      }
      

      This can also be seen with external executable facts that do not produce any output, or have errors, creating entries in `puppet facts diff`

      cat /etc/facter/facts.d/bad.sh
      #!/bin/sh
      echo bad=`abc`
       
      puppet facts diff
      Warning: Facter: external fact file "/etc/facter/facts.d/bad.sh" had output on stderr: /etc/facter/facts.d/bad.sh: line 2: abc: command not found
      Warning: Facter: external fact file "/etc/facter/facts.d/bad.sh" had output on stderr: /etc/facter/facts.d/bad.sh: line 2: abc: command not found
      {
        "bad": {
          "new_value": null,
          "old_value": ""
        }
      }
      

        Attachments

          Activity

            People

            Assignee:
            luchian.nemes Luchian Nemes
            Reporter:
            gheorghe.popescu Gheorghe Popescu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support