Merge branch 'master' of ssh://handel.debian.org/srv/puppet.debian.org/git/dsa-puppet
[mirror/dsa-puppet.git] / facts / raidcontroller.rb
index 263b16b..8a09a71 100644 (file)
@@ -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