Merge "Ensure interface names are downcased"

This commit is contained in:
Zuul 2018-03-16 23:40:47 +00:00 committed by Gerrit Code Review
commit 7d315ab2e8

View File

@ -11,7 +11,8 @@ module Puppet::Parser::Functions
ip1 = IPAddr.new(arg[0])
Dir.foreach('/sys/class/net/') do |interface|
next if interface == '.' || interface == '..'
iface_no_dash = interface.gsub('-', '_')
# puppet downcases fact names, interface names can have capitals
iface_no_dash = interface.gsub('-', '_').downcase
if ip1.ipv4?
ipaddress_name = "ipaddress_#{iface_no_dash}"