From: Tom Hughes Date: Wed, 2 Dec 2015 12:12:16 +0000 (+0000) Subject: Fix bug parsing HP RAID controller output X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/d1523ca3533017306b1587db23638d188f2db524 Fix bug parsing HP RAID controller output --- diff --git a/cookbooks/hardware/templates/default/ohai.rb.erb b/cookbooks/hardware/templates/default/ohai.rb.erb index b60d143f0..87560b8dd 100644 --- a/cookbooks/hardware/templates/default/ohai.rb.erb +++ b/cookbooks/hardware/templates/default/ohai.rb.erb @@ -314,7 +314,7 @@ Ohai.plugin(:Hardware) do devices[:disks] << disk controller[:disks] << disk[:id] array[:disks] << disk[:id] - elsif disk && line =~ /^ (\S[^:]+):\s+(\S.*\S)\s*$/ + elsif disk && line =~ /^ (\S[^:]+):\s+(.*\S)\s*$/ case Regexp.last_match(1) when "Interface Type" then disk[:interface] = Regexp.last_match(2) when "Size" then disk[:size] = Regexp.last_match(2) @@ -323,7 +323,7 @@ Ohai.plugin(:Hardware) do when "Serial Number" then disk[:serial_number] = Regexp.last_match(2) when "Model" then disk[:model] = Regexp.last_match(2) end - elsif array && line =~ /^ (\S[^:]+):\s+(\S.*\S)\s*$/ + elsif array && line =~ /^ (\S[^:]+):\s+(.*\S)\s*$/ case Regexp.last_match(1) when "Size" then array[:size] = Regexp.last_match(2) when "Fault Tolerance" then array[:raid_level] = Regexp.last_match(2)