Revision 77e1d753
b/daemons/ganeti-rapi | ||
---|---|---|
35 | 35 |
from ganeti import daemon |
36 | 36 |
from ganeti import ssconf |
37 | 37 |
from ganeti import utils |
38 |
from ganeti import luxi |
|
38 | 39 |
from ganeti.rapi import connector |
39 | 40 |
|
40 | 41 |
import ganeti.http.auth |
... | ... | |
144 | 145 |
sn = ctx.handler.getSerialNumber() |
145 | 146 |
if sn: |
146 | 147 |
req.response_headers[http.HTTP_ETAG] = str(sn) |
148 |
except luxi.TimeoutError: |
|
149 |
raise http.HttpGatewayTimeout() |
|
150 |
except luxi.ProtocolError, err: |
|
151 |
raise http.HttpBadGateway(str(err)) |
|
147 | 152 |
except: |
148 | 153 |
method = req.request_method.upper() |
149 | 154 |
logging.exception("Error while handling the %s request", method) |
b/lib/http/__init__.py | ||
---|---|---|
255 | 255 |
code = 501 |
256 | 256 |
|
257 | 257 |
|
258 |
class HttpBadGateway(HttpException): |
|
259 |
"""502 Bad Gateway |
|
260 |
|
|
261 |
RFC2616, 10.5.3: The server, while acting as a gateway or proxy, |
|
262 |
received an invalid response from the upstream server it accessed in |
|
263 |
attempting to fulfill the request. |
|
264 |
|
|
265 |
""" |
|
266 |
code = 502 |
|
267 |
|
|
268 |
|
|
258 | 269 |
class HttpServiceUnavailable(HttpException): |
259 | 270 |
"""503 Service Unavailable |
260 | 271 |
|
... | ... | |
265 | 276 |
code = 503 |
266 | 277 |
|
267 | 278 |
|
279 |
class HttpGatewayTimeout(HttpException): |
|
280 |
"""504 Gateway Timeout |
|
281 |
|
|
282 |
RFC2616, 10.5.5: The server, while acting as a gateway or proxy, did |
|
283 |
not receive a timely response from the upstream server specified by |
|
284 |
the URI (e.g. HTTP, FTP, LDAP) or some other auxiliary server |
|
285 |
(e.g. DNS) it needed to access in attempting to complete the |
|
286 |
request. |
|
287 |
|
|
288 |
""" |
|
289 |
code = 504 |
|
290 |
|
|
291 |
|
|
268 | 292 |
class HttpVersionNotSupported(HttpException): |
269 | 293 |
"""505 HTTP Version Not Supported |
270 | 294 |
|
Also available in: Unified diff