X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=facts%2Fraidcontroller.rb;h=8a09a71ca76c464d12db88d1cb5d9d982e2d27cd;hb=df361af8358dc4084afc4ec502cab8546d6bf47a;hp=263b16b24f95d3b11fbf6372b15c1ee83f2b90d1;hpb=68e9064da4758c291c8e7b839955f5031db00416;p=mirror%2Fdsa-puppet.git diff --git a/facts/raidcontroller.rb b/facts/raidcontroller.rb index 263b16b24..8a09a71ca 100644 --- a/facts/raidcontroller.rb +++ b/facts/raidcontroller.rb @@ -5,11 +5,11 @@ Facter.add("smartarraycontroller") do ishp = "false" lspciexists = system "/bin/bash -c 'which lspci >&/dev//null'" if $?.exitstatus == 0 - %x{lspci}.each { |s| + %x{lspci 2>&1}.each { |s| ishp = "true" if s =~ /RAID bus controller: (.*) Smart Array/ } end - ishp + ishp == "true" end end @@ -29,7 +29,7 @@ Facter.add("3warecontroller") do is3w = "true" if x =~ /Vendor: 3ware/ } end - is3w + is3w == "true" end end @@ -42,7 +42,7 @@ Facter.add("swraid") do swraid = "true" if x =~ /md[0-9]+ : active/ } end - swraid + swraid == "true" end end