diff options
author | mh <mh@immerda.ch> | 2013-01-04 16:00:55 +0100 |
---|---|---|
committer | mh <mh@immerda.ch> | 2013-01-04 16:00:55 +0100 |
commit | 94a86ffc5b8b563f5ba7d95e508a4ea6699f6776 (patch) | |
tree | 88988189c2c05a325921cf16729e6c292510a141 | |
parent | c2ea39b148de14512c757d0a6c4ca548cdf2ba17 (diff) |
ensure that it still works even if the output is nil
-rw-r--r-- | lib/facter/strongswan_ips.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |