From 3e2356d312d63264d7607b15728678b5d02382f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jason=20K=C3=B6lker?= Date: Mon, 23 May 2011 18:20:18 -0500 Subject: [PATCH] uhhh yea --- nova/tests/test_cloud.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/nova/tests/test_cloud.py b/nova/tests/test_cloud.py index c45bdd12..3c29a117 100644 --- a/nova/tests/test_cloud.py +++ b/nova/tests/test_cloud.py @@ -70,7 +70,7 @@ class CloudTestCase(test.TestCase): self.project = self.manager.create_project('proj', 'admin', 'proj') self.context = context.RequestContext(user=self.user, project=self.project) - host = self.network.get_network_host(self.context.elevated()) + host = self.network.host def fake_show(meh, context, id): return {'id': 1, 'properties': {'kernel_id': 1, 'ramdisk_id': 1, @@ -80,9 +80,9 @@ class CloudTestCase(test.TestCase): self.stubs.Set(local.LocalImageService, 'show_by_name', fake_show) def tearDown(self): - network_ref = db.project_get_network(self.context, - self.project.id) - db.network_disassociate(self.context, network_ref['id']) + networks = db.project_get_networks(self.context, self.project.id) + for network in networks: + db.network_disassociate(self.context, network['id']) self.manager.delete_project(self.project) self.manager.delete_user(self.user) self.compute.kill() @@ -124,7 +124,12 @@ class CloudTestCase(test.TestCase): 'host': self.network.host}) self.cloud.allocate_address(self.context) inst = db.instance_create(self.context, {'host': self.compute.host}) - fixed = self.network.allocate_fixed_ip(self.context, inst['id']) + networks = db.network_get_all(self.context) + print networks + print self.network.allocate_for_instance(self.context, inst) + + fixed = self.network.allocate_fixed_ip(self.context, inst, + networks[0]) ec2_id = ec2utils.id_to_ec2_id(inst['id']) self.cloud.associate_address(self.context, instance_id=ec2_id,