From: Stephen Gran Date: Sat, 28 Feb 2009 23:30:58 +0000 (+0000) Subject: Actually, I don't want an array of controllers, nice as that might be X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=e5c0e400b55db53606cfb42fc63006b4d5a41bd4;p=dsa-puppet.git Actually, I don't want an array of controllers, nice as that might be for other things. All I really care about is if the machine has something that looks an HP SmartArray controller, so we can make sure the extra software is installed. Signed-off-by: Stephen Gran --- diff --git a/facts/raidcontroller.rb b/facts/raidcontroller.rb index 5ec322ac..157060bc 100644 --- a/facts/raidcontroller.rb +++ b/facts/raidcontroller.rb @@ -2,14 +2,14 @@ Facter.add("raidcontroller") do confine :kernel => :linux ENV["PATH"]="/bin:/sbin:/usr/bin:/usr/sbin" setcode do - controllers = [] + ishp = False lspciexists = system "/bin/bash -c 'which lspci >&/dev//null'" if $?.exitstatus == 0 output = %x{lspci} output.each { |s| - controllers.push($1) if s =~ /RAID bus controller: (.*)/ + ishp == True if s =~ /RAID bus controller: (.*) Smart Array/ } end - controllers + ishp end end