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
- "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