summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/faults.py5
-rw-r--r--nova/api/openstack/limits.py2
2 files changed, 5 insertions, 2 deletions
diff --git a/nova/api/openstack/faults.py b/nova/api/openstack/faults.py
index ccccbd3d2..0e9c4b26f 100644
--- a/nova/api/openstack/faults.py
+++ b/nova/api/openstack/faults.py
@@ -91,7 +91,10 @@ class OverLimitFault(webob.exc.HTTPException):
@webob.dec.wsgify(RequestClass=wsgi.Request)
def __call__(self, request):
- """Currently just return the wrapped exception."""
+ """
+ Return the wrapped exception with a serialized body conforming to our
+ error format.
+ """
serializer = wsgi.Serializer(self._serialization_metadata)
content_type = request.best_match_content_type()
content = serializer.serialize(self.content, content_type)
diff --git a/nova/api/openstack/limits.py b/nova/api/openstack/limits.py
index 1fe519f8a..efc7d193d 100644
--- a/nova/api/openstack/limits.py
+++ b/nova/api/openstack/limits.py
@@ -151,7 +151,7 @@ class Limit(object):
water = self.water_level
val = self.value
- self.remaining = math.floor((cap - water) / cap * val)
+ self.remaining = math.floor(((cap - water) / cap) * val)
self.next_request = now
def _get_time(self):