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

facter json output converts all booleans to true

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: FACT 3.1.4
    • Fix Version/s: FACT 3.4.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      macOS 10.11

    • Template:
    • Story Points:
      1
    • Sprint:
      Client 2016-07-13 (HA, 1.5.3)
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Previously, all facter boolean values were returned true when json output was requested. This corrects the issue so that 'false' is returned when the fact value is 'false'

      Description

      When json output is requested, any fact value that is a boolean true/false is returned as true.

      This is a pretty huge regression.

      To recreate, add a simple fact like this:

      Facter.add('jsontest') do
        setcode do
          {'true' => true, 'false' => false}
        end
      end
      

      When called with normal output, the values are correct:

      # facter -p jsontest
      {
        true => true,
        false => false
      }
      

      When called with -j for json output, all values are true:

      # facter -p -j jsontest
      {
        "jsontest": {
          "true": true,
          "false": true
        }
      }
      

      Facter 2 works normally, as expected.

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                Unassigned
                Reporter:
                ccaviness Clay Caviness
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: