From 94a86ffc5b8b563f5ba7d95e508a4ea6699f6776 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 4 Jan 2013 16:00:55 +0100 Subject: ensure that it still works even if the output is nil --- lib/facter/strongswan_ips.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/facter/strongswan_ips.rb b/lib/facter/strongswan_ips.rb index 7d6f30b..7fac37e 100644 --- a/lib/facter/strongswan_ips.rb +++ b/lib/facter/strongswan_ips.rb @@ -2,7 +2,7 @@ Facter.add("strongswan_ips") do setcode do result = nil if bin = ['/usr/sbin/ipsec', '/usr/sbin/strongswan'].find{|f| File.exists?(f) } - output = Facter::Util::Resolution.exec("#{bin} statusall | grep -E '^ [0-9a-f]'").split("\n").collect(&:strip) + output = Facter::Util::Resolution.exec("#{bin} statusall | grep -E '^ [0-9a-f]'").to_s.split("\n").collect(&:strip) result = output.join(',') unless output.empty? end result -- cgit v1.2.3