projects
/
chef.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1a009f6
)
Handle unknown BMC manufacturers better
author
Tom Hughes
<tom@compton.nu>
Mon, 14 Dec 2015 11:57:59 +0000
(11:57 +0000)
committer
Tom Hughes
<tom@compton.nu>
Mon, 14 Dec 2015 11:57:59 +0000
(11:57 +0000)
cookbooks/hardware/templates/default/ohai.rb.erb
patch
|
blob
|
history
diff --git
a/cookbooks/hardware/templates/default/ohai.rb.erb
b/cookbooks/hardware/templates/default/ohai.rb.erb
index 21790a804d4db9794b51cf99ea02819344fe7c6c..09a9bced0db3291733ee8ea10cdb66935e30f207 100644
(file)
--- a/
cookbooks/hardware/templates/default/ohai.rb.erb
+++ b/
cookbooks/hardware/templates/default/ohai.rb.erb
@@
-796,7
+796,9
@@
Ohai.plugin(:Hardware) do
device = {}
IO.popen(["ipmitool", "mc", "info"]).each_with_object([]) do |line, devices|
device = {}
IO.popen(["ipmitool", "mc", "info"]).each_with_object([]) do |line, devices|
- if line =~ /(Product [A-Z ]+[A-Z])\s*:\s+(.*\S)\s+\(.*\)\s*$/i
+ if line =~ /(Manufacturer [A-Z ]+[A-Z])\s*:\s+(.*\S)\s+\(.*\)\s*$/i
+ device[Regexp.last_match(1).tr(" ", "_").downcase.to_sym] = Regexp.last_match(2)
+ elsif line =~ /(Product [A-Z ]+[A-Z])\s*:\s+(.*\S)\s+\(.*\)\s*$/i
device[Regexp.last_match(1).tr(" ", "_").downcase.to_sym] = Regexp.last_match(2)
elsif line =~ /([A-Z ]+[A-Z])\s*:\s+(.*\S)\s*$/i
device[Regexp.last_match(1).tr(" ", "_").downcase.to_sym] = Regexp.last_match(2)
device[Regexp.last_match(1).tr(" ", "_").downcase.to_sym] = Regexp.last_match(2)
elsif line =~ /([A-Z ]+[A-Z])\s*:\s+(.*\S)\s*$/i
device[Regexp.last_match(1).tr(" ", "_").downcase.to_sym] = Regexp.last_match(2)