summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2010-04-24 15:54:09 +1000
committerJames Turnbull <james@lovedthanlost.net>2010-04-24 16:11:15 +1000
commite19024bbef18a4a2053537415bfe16bfaff00b8a (patch)
tree35cc6e449757466d17ce2a395af9cb7ce7a4dd5c
parent97879f9f576484b54fde41326a87129a1fe4f8b6 (diff)
downloadfacter-e19024bbef18a4a2053537415bfe16bfaff00b8a.tar.gz
facter-e19024bbef18a4a2053537415bfe16bfaff00b8a.tar.xz
facter-e19024bbef18a4a2053537415bfe16bfaff00b8a.zip
Fixed #2938 - interfaces that don't match ^\w+[.:]?\d+ are ignored
Thanks to Tim Sharpe for the fix
-rw-r--r--lib/facter/util/ip.rb4
1 files 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