From e19024bbef18a4a2053537415bfe16bfaff00b8a Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Sat, 24 Apr 2010 15:54:09 +1000 Subject: Fixed #2938 - interfaces that don't match ^\w+[.:]?\d+ are ignored Thanks to Tim Sharpe for the fix --- lib/facter/util/ip.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/facter/util/ip.rb b/lib/facter/util/ip.rb index 5941d38..25acf3a 100644 --- a/lib/facter/util/ip.rb +++ b/lib/facter/util/ip.rb @@ -24,7 +24,7 @@ module Facter::Util::IP # Convert an interface name into purely alpha characters. def self.alphafy(interface) - interface.gsub(/[:.]/, '_') + interface.gsub(/[-:.]/, '_') end def self.convert_from_hex?(kernel) @@ -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(/:$/, '') }.uniq + output.scan(/^[-\w]+[.:]?\d+[.:]?\d*[.:]?\w*/).collect { |i| i.sub(/:$/, '') }.uniq end def self.get_all_interface_output -- cgit