quotas working and tests passing

This commit is contained in:
Vishvananda Ishaya
2010-09-09 23:04:30 -07:00
parent c7d98b5ca3
commit 19d7b97bb2
2 changed files with 1 additions and 9 deletions

View File

@@ -450,7 +450,6 @@ class CloudController(object):
@defer.inlineCallbacks
def allocate_address(self, context, **kwargs):
# check quota
print quota.allowed_floating_ips(context, 1)
if quota.allowed_floating_ips(context, 1) < 1:
logging.warn("Quota exceeeded for %s, tried to allocate address",
context.project.id)

View File

@@ -147,16 +147,9 @@ class QuotaTestCase(test.TrialTestCase):
'host': FLAGS.host})
float_addr = self.network.allocate_floating_ip(self.context,
self.project.id)
# NOTE(vish): This assert doesn't work. When cloud attempts to
# NOTE(vish): This assert never fails. When cloud attempts to
# make an rpc.call, the test just finishes with OK. It
# appears to be something in the magic inline callbacks
# that is breaking.
self.assertFailure(self.cloud.allocate_address(self.context),
cloud.QuotaError)
try:
yield self.cloud.allocate_address(self.context)
self.fail('Should have raised QuotaError')
except cloud.QuotaError:
pass