diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-11-18 14:13:27 -0800 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-11-18 15:21:54 -0800 |
commit | c7ed4c4250382017274a763fbeed1a7ef1380c27 (patch) | |
tree | 423cdc00ac5732b780a717c2cb9801952fd88cae | |
parent | dff33881402519b6d4a49cb64229ad46edbc8f96 (diff) | |
download | ohai-c7ed4c4250382017274a763fbeed1a7ef1380c27.tar.gz |
Simplify shellout and chomps
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/ohai/plugins/aix/virtualization.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/ohai/plugins/aix/virtualization.rb b/lib/ohai/plugins/aix/virtualization.rb index c98d956e..cd724df6 100644 --- a/lib/ohai/plugins/aix/virtualization.rb +++ b/lib/ohai/plugins/aix/virtualization.rb @@ -32,8 +32,7 @@ Ohai.plugin(:Virtualization) do virtualization[:lpar_name] = lpar_name end - so = shell_out("uname -W") - wpar_no = so.stdout.split($/)[0] + wpar_no = shell_out("uname -W").stdout.chomp if wpar_no.to_i > 0 virtualization[:wpar_no] = wpar_no else @@ -41,7 +40,7 @@ Ohai.plugin(:Virtualization) do so = shell_out("lswpar -L").stdout.scan(/={65}.*?(?:EXPORTED\n\n)+/m) wpars = Mash.new so.each do |wpar| - wpar_name = wpar.lines[1].split[0] + wpar_name = wpar.lines[1].chomp wpars[wpar_name] = Mash.new wpar.scan(/^[A-Z]{4,}.*?[A-Z\:0-9]$.*?\n\n/m).each do |section| |