projects
/
chef.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a3e9ec2
)
The smartd on 12.04 doesn't support /dev/bus syntax
author
Tom Hughes
<tom@compton.nu>
Fri, 13 Mar 2015 11:14:39 +0000
(11:14 +0000)
committer
Tom Hughes
<tom@compton.nu>
Fri, 13 Mar 2015 11:14:39 +0000
(11:14 +0000)
cookbooks/hardware/recipes/default.rb
patch
|
blob
|
history
diff --git
a/cookbooks/hardware/recipes/default.rb
b/cookbooks/hardware/recipes/default.rb
index 80473f779e1f36a8395ca1f0d4799f81b033a2f2..c9da86168f4fe00eebcc0aabaa02dd967c1d33cc 100644
(file)
--- a/
cookbooks/hardware/recipes/default.rb
+++ b/
cookbooks/hardware/recipes/default.rb
@@
-275,7
+275,8
@@
if status_packages["megaclisas-status"]
next unless driver == "megaraid_sas"
- device = host.sub("/sys/class/scsi_host/host", "bus/")
+ bus = host.sub("/sys/class/scsi_host/host", "")
+ device = File.basename(Dir.glob("/sys/bus/scsi/devices/#{bus}:*/scsi_generic/*").first)
IO.popen(["megacli", "-PDList", "-a#{controller}", "-NoLog"]).each do |line|
disks << { :device => device, :driver => "megaraid", :id => Regexp.last_match[1] } if line =~ /^Device Id: ([0-9]+)$/