diff options
author | mh <mh@immerda.ch> | 2013-08-10 20:54:09 +0200 |
---|---|---|
committer | mh <mh@immerda.ch> | 2013-08-10 20:54:09 +0200 |
commit | 36f1100cd8fd53fe47b417ec4ec064a63368ab08 (patch) | |
tree | 3211fea4406b15acc8ffef976f484fd5f4b83a77 | |
parent | 8016f252e14c9af93fd17753eeb20d035ccfcb7e (diff) | |
parent | f568a45101e8ef78c9bd03f6a8f38b56f1398ded (diff) |
Merge branch 'master' of git.puppet.immerda.ch:module-strongswan
-rw-r--r-- | lib/facter/strongswan_ips.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/facter/strongswan_ips.rb b/lib/facter/strongswan_ips.rb index b1ab7fd..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 - return 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 |