def ReadPublicEndpoints(self):
    try:
      # If the connection gets abandoned, ensure we don't hang more than
      # 70 seconds.
      url = PUBLIC_ENDPOINT_URL_PREFIX + self.last_etag
      request = urllib2.Request(url)
      request.add_unredirected_header('Metadata-Flavor', 'Google')
      u = self.urllib2.urlopen(request, timeout=70)
      addrs_data = u.read()
      headers = u.info().dict
      self.last_etag = headers.get('etag', self.default_last_etag)
    except urllib2.HTTPError as h:
      self.ResetEtag()
      # 404 is treated like an empty list, for backward compatibility.
      if h.code == 404:
        return []
      raise h
    return self.ParseIPAddrs(addrs_data)
Fetch list of public endpoint IPs from metadata server.
dataset/ETHPy150Open GoogleCloudPlatform/compute-image-packages/google-daemon/usr/share/google/google_daemon/address_manager.py/AddressManager.ReadPublicEndpoints