import logging


def _find_internal_ip_interface(iface_list):
  """Find an IP address that is internal from GCE.

  Args:
    iface_list: a list of GCE networkInterface.

  Returns:
    IP address string or None.
  """
  logger = logging.getLogger(__name__)
  for iface in iface_list:
    try:
      ip_addr = iface['networkIP']
      if ip_addr != '127.0.0.1':
        return ip_addr
    except KeyError:
      logger.warning('Network Interface has no "networkIP": %s', iface)

  logger.warning('Could not find internal IP interface in %s:', iface_list)
  return None