Bug #25322
openFacter 2.4.1 does not gather the MAC address of Infiniband card on centos 7
Description
The facter used by the discovery image does not gather the MAC address of infiniband card on centos 7 based discovery image. This is due to the change in the output of ifconfig command.
The following patch will fix it.
--- facter-2.4.6/lib/facter/util/ip.rb 2018-10-22 22:55:07.656121787 0400 if interface =~ /^ib/ then
++ facter-2.4.6p/lib/facter/util/ip.rb 2018-10-22 22:55:11.366121572 -0400@ -161,9 +161,9
@
output = Facter::Util::IP.ifconfig_interface(interface)
when 'Linux'
ifconfig_output = Facter::Util::IP.ifconfig_interface(interface)
if interface =~ /^ib.*/ then
real_mac_address = get_infiniband_macaddress(interface)
- output = ifconfig_output.sub(%r{(?:ether|HWaddr)\s+((\w{1,2}:){5,}\w{1,2})}, "HWaddr #{real_mac_address}")
+ output = ifconfig_output.sub(%r{(?:ether|HWaddr|infiniband)\s+((\w{1,2}:){5,}\w{1,2})}, "HWaddr #{real_mac_address}")
else
output = ifconfig_output
end
Updated by Raj Ayyampalayam over 6 years ago
--- facter-2.4.6/lib/facter/util/ip.rb 2018-10-22 22:55:07.656121787 -0400 +++ facter-2.4.6p/lib/facter/util/ip.rb 2018-10-22 22:55:11.366121572 -0400 @@ -161,9 +161,9 @@ output = Facter::Util::IP.ifconfig_interface(interface) when 'Linux' ifconfig_output = Facter::Util::IP.ifconfig_interface(interface) - if interface =~ /^ib/ then + if interface =~ /^ib.*/ then real_mac_address = get_infiniband_macaddress(interface) - output = ifconfig_output.sub(%r{(?:ether|HWaddr)\s+((\w{1,2}:){5,}\w{1,2})}, "HWaddr #{real_mac_address}") + output = ifconfig_output.sub(%r{(?:ether|HWaddr|infiniband)\s+((\w{1,2}:){5,}\w{1,2})}, "HWaddr #{real_mac_address}") else output = ifconfig_output end
Updated by Lukas Zapletal over 6 years ago
- Status changed from New to Need more information
- Triaged changed from No to Yes
Hello, thanks for the report. Can you push this into facter 2.x branch? Eventually we will rebase on 2.5.x series once this is fixed. Thanks.