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

Facter::Util::Resolution.exec no longer sets $?.exitstatus based on exec result

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • FACT 3.0.0
    • FACT 3.1.6
    • None
    • 3
    • Client 2016-01-13, Client 2016-04-20, Client 2016-05-04
    • Bug Fix
    • Facter::Util::Resolution.exec will now set the Ruby $? exit status variable

    Description

      The following worked with Facter 2, but produces an error in Facter 3.

      Facter.add("foo") do
        setcode do
          Facter::Util::Resolution.exec('echo hello')
          $?.exitstatus == 0
        end
      end
      

      Output is

      2015-12-12 12:04:56.346097 ERROR puppetlabs.facter - error while resolving custom fact "foo": undefined method `exitstatus' for nil:NilClass

      Facter::Util::Resolution.exec no longer sets $? to a Ruby Process::Status object.

      Attachments

        Issue Links

          Activity

            People

              branan Branan Riley
              michael.smith Michael Smith
              Votes:
              2 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support