From 811f131d5406742d3d5588c7642a512d5a049466 Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Sun, 18 Mar 2012 15:52:32 +0000 Subject: [PATCH] try to make these booleans Signed-off-by: Stephen Gran --- modules/debian-org/lib/facter/hosts.rb | 6 +++--- modules/debian-org/lib/facter/raidarray.rb | 8 ++++---- modules/debian-org/lib/facter/servertype.rb | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/debian-org/lib/facter/hosts.rb b/modules/debian-org/lib/facter/hosts.rb index b55c43b1a..2a6b692a2 100644 --- a/modules/debian-org/lib/facter/hosts.rb +++ b/modules/debian-org/lib/facter/hosts.rb @@ -1,17 +1,17 @@ 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 diff --git a/modules/debian-org/lib/facter/raidarray.rb b/modules/debian-org/lib/facter/raidarray.rb index 28fdca489..be4bbad19 100644 --- a/modules/debian-org/lib/facter/raidarray.rb +++ b/modules/debian-org/lib/facter/raidarray.rb @@ -8,13 +8,13 @@ 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 @@ -42,13 +42,13 @@ 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 diff --git a/modules/debian-org/lib/facter/servertype.rb b/modules/debian-org/lib/facter/servertype.rb index fa2f35ed6..e261e709a 100644 --- a/modules/debian-org/lib/facter/servertype.rb +++ b/modules/debian-org/lib/facter/servertype.rb @@ -5,5 +5,6 @@ Facter.add("kvmdomain") do else result = false end + result end end -- 2.20.1