projects
/
mirror
/
dsa-puppet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Trailing line ending characters are sometimes nice
[mirror/dsa-puppet.git]
/
modules
/
debian-org
/
lib
/
facter
/
raidarray.rb
diff --git
a/modules/debian-org/lib/facter/raidarray.rb
b/modules/debian-org/lib/facter/raidarray.rb
index
28fdca4
..
7dc29c3
100644
(file)
--- a/
modules/debian-org/lib/facter/raidarray.rb
+++ b/
modules/debian-org/lib/facter/raidarray.rb
@@
-1,54
+1,72
@@
Facter.add("smartarraycontroller") do
confine :kernel => :linux
setcode do
Facter.add("smartarraycontroller") do
confine :kernel => :linux
setcode do
- FileTest.exist?("/dev/cciss/")
+ if FileTest.exist?("/dev/cciss/")
+ true
+ elsif FileTest.exist?("/sys/module/hpsa/")
+ true
+ else
+ ''
+ end
end
end
Facter.add("ThreeWarecontroller") do
confine :kernel => :linux
setcode do
end
end
Facter.add("ThreeWarecontroller") do
confine :kernel => :linux
setcode do
- is3w =
"false"
+ is3w =
''
if FileTest.exist?("/proc/scsi/scsi")
IO.foreach("/proc/scsi/scsi") { |x|
if FileTest.exist?("/proc/scsi/scsi")
IO.foreach("/proc/scsi/scsi") { |x|
- is3w =
"true"
if x =~ /Vendor: 3ware/
+ is3w =
true
if x =~ /Vendor: 3ware/
}
end
}
end
- is3w
== "true"
+ is3w
end
end
Facter.add("megaraid") do
confine :kernel => :linux
setcode do
end
end
Facter.add("megaraid") do
confine :kernel => :linux
setcode do
- FileTest.exist?("/dev/megadev0")
+ if FileTest.exist?("/dev/megadev0")
+ true
+ else
+ ''
+ end
end
end
Facter.add("mptraid") do
confine :kernel => :linux
setcode do
end
end
Facter.add("mptraid") do
confine :kernel => :linux
setcode do
- FileTest.exist?("/dev/mptctl") or FileTest.exist?("/dev/mpt0") or FileTest.exist?("/proc/mpt/summary")
+ if FileTest.exist?("/dev/mptctl") or FileTest.exist?("/dev/mpt0") or FileTest.exist?("/proc/mpt/summary")
+ true
+ else
+ ''
+ end
end
end
Facter.add("aacraid") do
confine :kernel => :linux
setcode do
end
end
Facter.add("aacraid") do
confine :kernel => :linux
setcode do
- FileTest.exist?("/dev/aac0")
+ if FileTest.exist?("/dev/aac0")
+ true
+ else
+ ''
+ end
end
end
Facter.add("swraid") do
confine :kernel => :linux
setcode do
end
end
Facter.add("swraid") do
confine :kernel => :linux
setcode do
- swraid =
"false"
+ swraid =
''
if FileTest.exist?("/proc/mdstat") && FileTest.exist?("/sbin/mdadm")
IO.foreach("/proc/mdstat") { |x|
if FileTest.exist?("/proc/mdstat") && FileTest.exist?("/sbin/mdadm")
IO.foreach("/proc/mdstat") { |x|
- swraid =
"true"
if x =~ /md[0-9]+ : active/
+ swraid =
true
if x =~ /md[0-9]+ : active/
}
end
}
end
- swraid
== "true"
+ swraid
end
end
end
end