diff options
author | Richard McLeod <richard.mcleod@gmail.com> | 2018-02-12 15:36:42 -0500 |
---|---|---|
committer | Bryan McLellan <btm@loftninjas.org> | 2018-03-27 13:20:17 -0400 |
commit | ea291abf670d404108ebb096925cd727962d8b23 (patch) | |
tree | 0ff39cec05ed45091de1179f9887741f3d38b046 | |
parent | f0c41faeb816cb3354f5409146ae40f4609be7ce (diff) | |
download | ohai-ea291abf670d404108ebb096925cd727962d8b23.tar.gz |
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.
-rw-r--r-- | lib/ohai/plugins/aix/uptime.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |