def _FindMacAddresses(self):
    """Find MAC addresses for network adapters."""
    for item in self._GetDataTypeItems('network'):
      if 'hardware' in item:
        if 'Ethernet' in item and 'MAC Address' in item['Ethernet']:
          intf_mac = item['Ethernet']['MAC Address']
          intf_name = item.get('interface', None)

          if item['hardware'] == 'Ethernet':
            intf_type = 'ethernet'
          elif item['hardware'] == 'AirPort':
            intf_type = 'airport'
          elif item['hardware'] == 'FireWire':
            intf_type = 'firewire'
          else:
            intf_type = None

          if intf_type is not None:
            self._profile['%s_mac' % intf_type] = intf_mac
            if intf_name is not None:
              self._profile['interface_%s' % intf_name] = intf_type
dataset/ETHPy150Open google/simian/src/simian/mac/common/hw.py/SystemProfile._FindMacAddresses/original