summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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