components/ruby/facter/patches/facter-03-FACT-658.patch
author Patrick Einheber <patrick.einheber@oracle.com>
Wed, 27 Apr 2016 14:55:10 -0700
changeset 5860 afd31ba91ee9
parent 2068 4e371f01e40f
permissions -rw-r--r--
23146903 Puppet and OpenStack modules need modification notices

Patch for FACT-658 facter doesn't parse gnu uptime output
Upstream bug: https://tickets.puppetlabs.com/browse/FACT-658

--- facter-2.4.6/lib/facter/util/uptime.rb.orig	2016-04-19 15:19:02.924027657 -0700
+++ facter-2.4.6/lib/facter/util/uptime.rb	2016-04-19 15:20:09.128836906 -0700
@@ -1,3 +1,7 @@
+#######################################################################
+# Oracle has modified the originally distributed contents of this file.
+#######################################################################
+
 require 'time'
 
 # A module to gather uptime facts
@@ -78,6 +82,14 @@
   end
 
   def self.uptime_executable_cmd
-    "uptime"
+    if Facter.value(:kernel) == 'SunOS'
+      # Facter doesn't work with gnu uptime
+      # force use of /usr/bin/uptime
+      # in case user PATH has /usr/gnu/bin
+      # before /usr/bin
+      "/usr/bin/uptime"
+    else
+      "uptime"
+    end
   end
 end