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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: FACT 3.0.0
    • Fix Version/s: FACT 3.1.6
    • Component/s: None
    • Labels:
    • Template:
    • Story Points:
      3
    • Sprint:
      Client 2016-01-13, Client 2016-04-20, Client 2016-05-04
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      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

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

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support