def _finish_query_lookupd(self, response, lookupd_url):
        if response.error:
            logger.warning('[%s] lookupd %s query error: %s',
                           self.name, lookupd_url, response.error)
            return

        try:
            lookup_data = json.loads(response.body)
        except __HOLE__:
            logger.warning('[%s] lookupd %s failed to parse JSON: %r',
                           self.name, lookupd_url, response.body)
            return

        if lookup_data['status_code'] != 200:
            logger.warning('[%s] lookupd %s responded with %d',
                           self.name, lookupd_url, lookup_data['status_code'])
            return

        for producer in lookup_data['data']['producers']:
            # TODO: this can be dropped for 1.0
            address = producer.get('broadcast_address', producer.get('address'))
            assert address
            self.connect_to_nsqd(address, producer['tcp_port'])
dataset/ETHPy150Open nsqio/pynsq/nsq/reader.py/Reader._finish_query_lookupd