From 406ff304bb09f144a59448e0e9d2d01160c7d553 Mon Sep 17 00:00:00 2001 From: "Kevin L. Mitchell" Date: Fri, 4 May 2012 19:27:43 -0500 Subject: Rearchitect quota checking to partially fix bug 938317. This is a rearchitecting/rewriting of quota handling to correct the quota atomicity issues highlighted by bug 938317. Partially implements blueprint quota-refactor as well. This change is fairly substantial. To make it easier to review, it has been broken up into 3 parts. This is the first part. Change-Id: I805f5750c08de17487e59fe33fad0bed203188a6 --- nova/exception.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'nova/exception.py') diff --git a/nova/exception.py b/nova/exception.py index af4850367..bcca2a6dc 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -689,10 +689,23 @@ class AccessKeyNotFound(NotFound): message = _("Access Key %(access_key)s could not be found.") +class InvalidReservationExpiration(Invalid): + message = _("Invalid reservation expiration %(expire)s.") + + +class InvalidQuotaValue(Invalid): + message = _("Change would make usage less than 0 for the following " + "resources: %(unders)s") + + class QuotaNotFound(NotFound): message = _("Quota could not be found") +class QuotaResourceUnknown(QuotaNotFound): + message = _("Unknown quota resources %(unknown)s.") + + class ProjectQuotaNotFound(QuotaNotFound): message = _("Quota for project %(project_id)s could not be found.") @@ -701,6 +714,18 @@ class QuotaClassNotFound(QuotaNotFound): message = _("Quota class %(class_name)s could not be found.") +class QuotaUsageNotFound(QuotaNotFound): + message = _("Quota usage for project %(project_id)s could not be found.") + + +class ReservationNotFound(QuotaNotFound): + message = _("Quota reservation %(uuid)s could not be found.") + + +class OverQuota(NovaException): + message = _("Quota exceeded for resources: %(overs)s") + + class SecurityGroupNotFound(NotFound): message = _("Security group %(security_group_id)s not found.") -- cgit