abusehelper: Fix botnets fact with old ruby versions
This commit is contained in:
parent
b0f01e7318
commit
e488015a28
1 changed files with 1 additions and 1 deletions
|
@ -4,7 +4,7 @@ Facter.add(:botnets) do
|
||||||
if File.executable?("/usr/bin/botnet")
|
if File.executable?("/usr/bin/botnet")
|
||||||
listcmd = "su -s /bin/sh - nobody -c '/usr/bin/botnet list'"
|
listcmd = "su -s /bin/sh - nobody -c '/usr/bin/botnet list'"
|
||||||
output = Facter::Util::Resolution.exec(listcmd)
|
output = Facter::Util::Resolution.exec(listcmd)
|
||||||
output.lines.each do |line|
|
output.each_line do |line|
|
||||||
if m = line.match(/^\[\d+\]\s+(.*\.py)/)
|
if m = line.match(/^\[\d+\]\s+(.*\.py)/)
|
||||||
botnets << File.basename(File.dirname(m[1]))
|
botnets << File.basename(File.dirname(m[1]))
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue