From 39628d1347fbefd60f9fe6763f64a0fe5e42cff9 Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Wed, 5 Aug 2009 08:54:20 +0100 Subject: [PATCH] We know where lspci wil be Signed-off-by: Stephen Gran --- facts/raidarray.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/facts/raidarray.rb b/facts/raidarray.rb index acf5ae219..31d5b7938 100644 --- a/facts/raidarray.rb +++ b/facts/raidarray.rb @@ -3,9 +3,8 @@ Facter.add("smartarraycontroller") do ENV["PATH"]="/bin:/sbin:/usr/bin:/usr/sbin" setcode do ishp = "false" - lspciexists = system "/bin/bash -c 'which lspci >&/dev//null'" - if (lspciexists && (FileTest.exist?("/proc/bus/pci"))) - %x{lspci 2>&1}.each { |s| + if ((FileTest.executable?("/usr/bin/lspci")) && (FileTest.exist?("/proc/bus/pci"))) + %x{lspci}.each { |s| ishp = "true" if s =~ /RAID bus controller: (.*) Smart Array/ } end -- 2.20.1