From 17623a4e889ff61bdf9ac87982ccb09a0bb14f72 Mon Sep 17 00:00:00 2001 From: o Date: Sat, 10 Aug 2013 19:45:07 +0200 Subject: another fix to the factor lib --- 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 b1ab7fd..8875309 100644 --- a/lib/facter/strongswan_ips.rb +++ b/lib/facter/strongswan_ips.rb @@ -3,7 +3,7 @@ Facter.add("strongswan_ips") do bin = ['/usr/sbin/ipsec', '/usr/sbin/strongswan'].find do |f| File.exists?(f) end - return unless bin + break unless bin output = Facter::Util::Resolution.exec( "#{bin} statusall | grep -E '^ [0-9a-f]' | sort | uniq") output = output.to_s.split("\n").collect(&:strip) -- cgit v1.2.3 From f568a45101e8ef78c9bd03f6a8f38b56f1398ded Mon Sep 17 00:00:00 2001 From: o Date: Sat, 10 Aug 2013 19:47:10 +0200 Subject: fix again... --- lib/facter/strongswan_ips.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/facter/strongswan_ips.rb b/lib/facter/strongswan_ips.rb index 8875309..4382d07 100644 --- a/lib/facter/strongswan_ips.rb +++ b/lib/facter/strongswan_ips.rb @@ -3,10 +3,11 @@ Facter.add("strongswan_ips") do bin = ['/usr/sbin/ipsec', '/usr/sbin/strongswan'].find do |f| File.exists?(f) end - break unless bin - output = Facter::Util::Resolution.exec( - "#{bin} statusall | grep -E '^ [0-9a-f]' | sort | uniq") - output = output.to_s.split("\n").collect(&:strip) - output.join(',') unless output.empty? + if bin + output = Facter::Util::Resolution.exec( + "#{bin} statusall | grep -E '^ [0-9a-f]' | sort | uniq") + output = output.to_s.split("\n").collect(&:strip) + output.join(',') unless output.empty? + end end end -- cgit v1.2.3