quotas working and tests passing
This commit is contained in:
@@ -450,7 +450,6 @@ class CloudController(object):
|
|||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def allocate_address(self, context, **kwargs):
|
def allocate_address(self, context, **kwargs):
|
||||||
# check quota
|
# check quota
|
||||||
print quota.allowed_floating_ips(context, 1)
|
|
||||||
if quota.allowed_floating_ips(context, 1) < 1:
|
if quota.allowed_floating_ips(context, 1) < 1:
|
||||||
logging.warn("Quota exceeeded for %s, tried to allocate address",
|
logging.warn("Quota exceeeded for %s, tried to allocate address",
|
||||||
context.project.id)
|
context.project.id)
|
||||||
|
@@ -147,16 +147,9 @@ class QuotaTestCase(test.TrialTestCase):
|
|||||||
'host': FLAGS.host})
|
'host': FLAGS.host})
|
||||||
float_addr = self.network.allocate_floating_ip(self.context,
|
float_addr = self.network.allocate_floating_ip(self.context,
|
||||||
self.project.id)
|
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
|
# make an rpc.call, the test just finishes with OK. It
|
||||||
# appears to be something in the magic inline callbacks
|
# appears to be something in the magic inline callbacks
|
||||||
# that is breaking.
|
# that is breaking.
|
||||||
self.assertFailure(self.cloud.allocate_address(self.context),
|
self.assertFailure(self.cloud.allocate_address(self.context),
|
||||||
cloud.QuotaError)
|
cloud.QuotaError)
|
||||||
try:
|
|
||||||
yield self.cloud.allocate_address(self.context)
|
|
||||||
self.fail('Should have raised QuotaError')
|
|
||||||
except cloud.QuotaError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user