|
|
@ -238,13 +238,19 @@ def gather_vm_facts(content, vm):
|
|
|
|
if not hasattr(entry, 'macAddress'):
|
|
|
|
if not hasattr(entry, 'macAddress'):
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if entry.macAddress:
|
|
|
|
|
|
|
|
mac_addr = entry.macAddress
|
|
|
|
|
|
|
|
mac_addr_dash = mac_addr.replace(':', '-')
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
mac_addr = mac_addr_dash = None
|
|
|
|
|
|
|
|
|
|
|
|
factname = 'hw_eth' + str(ethernet_idx)
|
|
|
|
factname = 'hw_eth' + str(ethernet_idx)
|
|
|
|
facts[factname] = {
|
|
|
|
facts[factname] = {
|
|
|
|
'addresstype': entry.addressType,
|
|
|
|
'addresstype': entry.addressType,
|
|
|
|
'label': entry.deviceInfo.label,
|
|
|
|
'label': entry.deviceInfo.label,
|
|
|
|
'macaddress': entry.macAddress,
|
|
|
|
'macaddress': mac_addr,
|
|
|
|
'ipaddresses': net_dict.get(entry.macAddress, None),
|
|
|
|
'ipaddresses': net_dict.get(entry.macAddress, None),
|
|
|
|
'macaddress_dash': entry.macAddress.replace(':', '-'),
|
|
|
|
'macaddress_dash': mac_addr_dash,
|
|
|
|
'summary': entry.deviceInfo.summary,
|
|
|
|
'summary': entry.deviceInfo.summary,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
facts['hw_interfaces'].append('eth' + str(ethernet_idx))
|
|
|
|
facts['hw_interfaces'].append('eth' + str(ethernet_idx))
|
|
|
|