Merge "Rename QuotaExists to QuotaAlreadyExists"

This commit is contained in:
Zuul 2018-09-09 02:33:32 +00:00 committed by Gerrit Code Review
commit ccfdbed1ae
3 changed files with 5 additions and 5 deletions

View File

@ -54,7 +54,7 @@ class QuotaController(base.Controller):
hard_limit=value)
try:
quota.create(context)
except exception.QuotaExists:
except exception.QuotaAlreadyExists:
quota.update(context)
return self._get_quotas(context)

View File

@ -717,8 +717,8 @@ class ProjectQuotaNotFound(QuotaNotFound):
message = _("Quota for project %(project_id)s could not be found.")
class QuotaExists(ZunException):
message = _("Quota exists for project %(project_id)s, "
class QuotaAlreadyExists(ZunException):
message = _("Quota already exists for project %(project_id)s, "
"resource %(resource)s.")

View File

@ -1053,8 +1053,8 @@ class Connection(object):
try:
quota_ref.save(session=session)
except db_exc.DBDuplicateEntry:
raise exception.QuotaExists(project_id=project_id,
resource=resource)
raise exception.QuotaAlreadyExists(project_id=project_id,
resource=resource)
return quota_ref
def quota_get(self, context, project_id, resource):