diff options
author | Richard McLeod <richard.mcleod@gmail.com> | 2018-02-12 15:36:42 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-12 15:36:42 -0500 |
commit | c1fcfd8779dc2436df459e5ad5f64ab584be9dbd (patch) | |
tree | 8ca90ae17e5a29eec89305d3de5f35640b87260e /lib/ohai/plugins | |
parent | 849a4caf9926a4e11f12f9175b6f4dcd8a9ccaf1 (diff) | |
download | ohai-c1fcfd8779dc2436df459e5ad5f64ab584be9dbd.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.
Diffstat (limited to 'lib/ohai/plugins')
-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 |