Refactor of QuotaError

moved QuotaError from quota.py to exception.py

Change-Id: Ic03301492a2df323074d73e8481e0e3aee89f74c
This commit is contained in:
Joe Gordon 2011-11-10 16:00:08 -08:00
parent 74d505352e
commit 7a44dd1ae6
3 changed files with 6 additions and 7 deletions

View File

@ -871,3 +871,8 @@ class NoValidHost(NovaException):
class WillNotSchedule(NovaException):
message = _("Host %(host)s is not up or doesn't exist.")
class QuotaError(ApiError):
"""Quota Exceeded."""
pass

View File

@ -162,8 +162,3 @@ def allowed_injected_file_content_bytes(context, requested_bytes):
def allowed_injected_file_path_bytes(context):
"""Return the number of bytes allowed in an injected file path."""
return FLAGS.quota_max_injected_file_path_bytes
class QuotaError(exception.ApiError):
"""Quota Exceeded."""
pass

View File

@ -20,7 +20,6 @@ from nova import context
from nova import db
from nova import exception
from nova import log as logging
from nova import quota
from nova import rpc
from nova import test
from nova.network import manager as network_manager
@ -463,7 +462,7 @@ class VlanNetworkTestCase(test.TestCase):
# this time should raise
self.stubs.Set(self.network.db, 'floating_ip_count_by_project', fake2)
self.assertRaises(quota.QuotaError,
self.assertRaises(exception.QuotaError,
self.network.allocate_floating_ip,
ctxt,
ctxt.project_id)