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

Facter.fact returns object when fact does not exist

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: FACT 4.1.0
    • Fix Version/s: FACT 4.1.1
    • Component/s: None
    • Labels:
    • Template:
    • Team:
      Night's Watch
    • Sprint:
      NW - 2021-04-28
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      The behaviour of Facter.fact has changed between 4.0.52 and 4.1.0. Instead of returning nil if a fact does not exist, it now returns an object of type ResolvedFact with its value set to nil. This is now fixed.
    • QA Risk Assessment:
      Needs Assessment

      Description

      The behavior of Facter.fact has changed between 4.0.52 and 4.1.0. Instead of returning nil if a fact does not exist, it now returns an object of type ResolvedFact with its value set to nil.

      The correct and documented behavior is to return nil if a fact does not exist:
      https://github.com/puppetlabs/facter/blob/main/lib/facter.rb#L407-L408

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gheorghe.popescu Gheorghe Popescu
              Reporter:
              gabriel.nagy Gabriel Nagy
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support