From c1fcfd8779dc2436df459e5ad5f64ab584be9dbd Mon Sep 17 00:00:00 2001 From: Richard McLeod Date: Mon, 12 Feb 2018 15:36:42 -0500 Subject: adds whitespace stripping for the shellout stdout turns out, ibm intentionally adds whitespace to the output here when the days number is 1-9. adding .strip cleans up the stdout so the case regex can properly evaluate the data. --- lib/ohai/plugins/aix/uptime.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/ohai/plugins') diff --git a/lib/ohai/plugins/aix/uptime.rb b/lib/ohai/plugins/aix/uptime.rb index 85537ba7..ec515aa2 100644 --- a/lib/ohai/plugins/aix/uptime.rb +++ b/lib/ohai/plugins/aix/uptime.rb @@ -27,7 +27,7 @@ Ohai.plugin(:Uptime) do # 1148-20:54:50 # This reads as 1148 days, 20 hours, 54 minutes, 50 seconds since the process was started (elapsed) # who -b does not return the YEAR, so we need something more concrete - so = shell_out("LC_ALL=POSIX ps -o etime= -p 1").stdout + so = shell_out("LC_ALL=POSIX ps -o etime= -p 1").stdout.strip # Here we'll check our shell_out for a dash, which indicates there is a # of days involved # We'll chunk off the days, hours (where applicable), minutes, seconds into seperate vars -- cgit v1.2.1