

def testserver(self, server):
    if server.ssl:
        prefix = 'https://'
    else:
        prefix = 'http://'
    try:
        url = (prefix + ('%s' % server.serverdomain))
        result = urlfetch.fetch(url, headers={
            'Cache-Control': 'max-age=30',
        }, deadline=10)
    except DownloadError:
        if server.falsepositivecheck:
            self.serverisdown(server, 0)
        else:
            server.falsepositivecheck = True
            server.put()
    else:
        if (result.status_code == 500):
            self.serverisdown(server, result.status_code)
        else:
            self.serverisup(server, result.status_code)

dataset/ETHPy150Open infincia/AEServmon/checkservers.py CheckServers.testserver/original