Signed-off-by: Stephen Gran <steve@lobefin.net>
Facter.add("brokenhosts") do
- brokenhosts = "true"
+ brokenhosts = true
if FileTest.exist?("/etc/hosts")
IO.foreach("/etc/hosts") do |x|
x.split.each do |y|
if y == Facter.value("fqdn")
- brokenhosts = "false"
+ brokenhosts = false
break
end
end
end
end
setcode do
- brokenhosts == "true"
+ brokenhosts
end
end
Facter.add("ThreeWarecontroller") do
confine :kernel => :linux
setcode do
- is3w = "false"
+ is3w = false
if FileTest.exist?("/proc/scsi/scsi")
IO.foreach("/proc/scsi/scsi") { |x|
is3w = "true" if x =~ /Vendor: 3ware/
}
end
- is3w == "true"
+ is3w
end
end
Facter.add("swraid") do
confine :kernel => :linux
setcode do
- swraid = "false"
+ swraid = false
if FileTest.exist?("/proc/mdstat") && FileTest.exist?("/sbin/mdadm")
IO.foreach("/proc/mdstat") { |x|
swraid = "true" if x =~ /md[0-9]+ : active/
}
end
- swraid == "true"
+ swraid
end
end
else
result = false
end
+ result
end
end