From fbf1ee2069450eb6b55d18fafea6aa44874219c9 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Tue, 17 Jul 2012 04:00:51 +0100 Subject: [PATCH] Remove unused OverLimitFault Only used by compute limits in Nova. Change-Id: I065ca64e060acc0773189f1497fcc54041621f39 --- cinder/api/openstack/wsgi.py | 47 ------------------------------------ 1 file changed, 47 deletions(-) diff --git a/cinder/api/openstack/wsgi.py b/cinder/api/openstack/wsgi.py index bb309056e..9454e961c 100644 --- a/cinder/api/openstack/wsgi.py +++ b/cinder/api/openstack/wsgi.py @@ -1070,53 +1070,6 @@ class Fault(webob.exc.HTTPException): return self.wrapped_exc.__str__() -class OverLimitFault(webob.exc.HTTPException): - """ - Rate-limited request response. - """ - - def __init__(self, message, details, retry_time): - """ - Initialize new `OverLimitFault` with relevant information. - """ - hdrs = OverLimitFault._retry_after(retry_time) - self.wrapped_exc = webob.exc.HTTPRequestEntityTooLarge(headers=hdrs) - self.content = { - "overLimitFault": { - "code": self.wrapped_exc.status_int, - "message": message, - "details": details, - }, - } - - @staticmethod - def _retry_after(retry_time): - delay = int(math.ceil(retry_time - time.time())) - retry_after = delay if delay > 0 else 0 - headers = {'Retry-After': '%d' % retry_after} - return headers - - @webob.dec.wsgify(RequestClass=Request) - def __call__(self, request): - """ - Return the wrapped exception with a serialized body conforming to our - error format. - """ - content_type = request.best_match_content_type() - metadata = {"attributes": {"overLimitFault": "code"}} - - xml_serializer = XMLDictSerializer(metadata, XMLNS_V1) - serializer = { - 'application/xml': xml_serializer, - 'application/json': JSONDictSerializer(), - }[content_type] - - content = serializer.serialize(self.content) - self.wrapped_exc.body = content - - return self.wrapped_exc - - def _set_request_id_header(req, headers): context = req.environ.get('cinder.context') if context: -- 2.45.2