summaryrefslogtreecommitdiffstats
path: root/lib/facter
diff options
context:
space:
mode:
authorPaul Nasrat <pnasrat@googlemail.com>2009-08-11 17:45:40 +0100
committerPaul Nasrat <pnasrat@googlemail.com>2009-08-12 08:30:41 +0100
commitfe41fb80dda8c96814b7a57875331b731dd04395 (patch)
treef48f21abd8bda6105bad36a187b721f617e55236 /lib/facter
parentbe9e484c0daaf4befb0dfbcf85bda08ce6c1effd (diff)
downloadfacter-fe41fb80dda8c96814b7a57875331b731dd04395.tar.gz
facter-fe41fb80dda8c96814b7a57875331b731dd04395.tar.xz
facter-fe41fb80dda8c96814b7a57875331b731dd04395.zip
Fix #2470 - duplicate entries in interfaces fact
Solaris orders inet and inet6 seperately. This tests for and fixes this by uniqueing the list. Will probably need work when we get to ipv6 support.
Diffstat (limited to 'lib/facter')
-rw-r--r--lib/facter/util/ip.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/facter/util/ip.rb b/lib/facter/util/ip.rb
index fb32d70..9fb7034 100644
--- a/lib/facter/util/ip.rb
+++ b/lib/facter/util/ip.rb
@@ -51,7 +51,7 @@ module Facter::Util::IP
# at the end of interfaces. So, we have to trim those trailing
# characters. I tried making the regex better but supporting all
# platforms with a single regex is probably a bit too much.
- output.scan(/^\w+[.:]?\d+[.:]?\d*[.:]?\w*/).collect { |i| i.sub(/:$/, '') }
+ output.scan(/^\w+[.:]?\d+[.:]?\d*[.:]?\w*/).collect { |i| i.sub(/:$/, '') }.uniq
end
def self.get_all_interface_output