def _get_remote_stats(clusterid):
    target = app.config['GLOBAL_CLUSTERS'][clusterid]['host'] + '/stats'
    headers = {'X-API-KEY': app.config['GLOBAL_CLUSTERS'][clusterid]['key']}
    try:
        req = urllib2.Request(target, headers=headers)
        res = urllib2.urlopen(req, timeout=app.config['REMOTE_TIMEOUT'])
        return json.loads(res.read())[clusterid]
    except Exception as err:
        logger.exception("Error grabbing stats for %s: %s" % (clusterid, err))
        return None
dataset/ETHPy150Open pandemicsyn/stalker/stalkerweb/stalkerweb/views.py/_get_remote_stats/original