return http response from wait_for_http_server

This commit is contained in:
Min RK
2017-06-07 12:38:56 +02:00
parent 0a30e0ade5
commit cdcc7fc3c1
2 changed files with 4 additions and 5 deletions

View File

@@ -89,13 +89,13 @@ def wait_for_http_server(url, timeout=10):
yield gen.sleep(0.1)
else:
app_log.debug("Server at %s responded with %s", url, e.code)
return
return e.response
except (OSError, socket.error) as e:
if e.errno not in {errno.ECONNABORTED, errno.ECONNREFUSED, errno.ECONNRESET}:
app_log.warning("Failed to connect to %s (%s)", url, e)
yield gen.sleep(0.1)
else:
return
return r
raise TimeoutError(
"Server at {url} didn't respond in {timeout} seconds".format(**locals())