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

Facter.fact returns object when fact does not exist

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • FACT 4.1.0
    • FACT 4.1.1
    • None
    • Night's Watch
    • NW - 2021-04-28
    • Needs Assessment
    • Bug Fix
    • 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.
    • 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

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

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support