From e488015a2884aceda0a3d50609938c7b5bc5c124 Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Thu, 10 Oct 2013 16:48:00 +0300 Subject: [PATCH] abusehelper: Fix botnets fact with old ruby versions --- abusehelper/lib/facter/botnets.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abusehelper/lib/facter/botnets.rb b/abusehelper/lib/facter/botnets.rb index 5921fbc..75000f9 100644 --- a/abusehelper/lib/facter/botnets.rb +++ b/abusehelper/lib/facter/botnets.rb @@ -4,7 +4,7 @@ Facter.add(:botnets) do if File.executable?("/usr/bin/botnet") listcmd = "su -s /bin/sh - nobody -c '/usr/bin/botnet list'" output = Facter::Util::Resolution.exec(listcmd) - output.lines.each do |line| + output.each_line do |line| if m = line.match(/^\[\d+\]\s+(.*\.py)/) botnets << File.basename(File.dirname(m[1])) end