From 1bf89924ba6eafc394612f9d62c1b52251825b2b Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Wed, 2 Jan 2013 10:32:38 -0800 Subject: Move block_device_mapping get operations to conductor This patch moves the block_device_mapping_get_by_instance() uses from compute/manager to the conductor. This also includes some nasty refactoring in some of compute's helper methods to pass around instances instead of just uuids so that we can properly pass the former to the conductor. Related to blueprint no-db-compute-manager Change-Id: Ib5223274d21096a9e47b3420c3de801b978b253d --- nova/tests/conductor/test_conductor.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'nova/tests') diff --git a/nova/tests/conductor/test_conductor.py b/nova/tests/conductor/test_conductor.py index 0d1ff1d60..4aa552cc7 100644 --- a/nova/tests/conductor/test_conductor.py +++ b/nova/tests/conductor/test_conductor.py @@ -268,6 +268,17 @@ class _BaseTestCase(object): 'fake-arch') self.assertEqual(result, 'it worked') + def test_block_device_mapping_get_all_by_instance(self): + fake_inst = {'uuid': 'fake-uuid'} + self.mox.StubOutWithMock(db, + 'block_device_mapping_get_all_by_instance') + db.block_device_mapping_get_all_by_instance( + self.context, fake_inst['uuid']).AndReturn('fake-result') + self.mox.ReplayAll() + result = self.conductor.block_device_mapping_get_all_by_instance( + self.context, fake_inst) + self.assertEqual(result, 'fake-result') + class ConductorTestCase(_BaseTestCase, test.TestCase): """Conductor Manager Tests""" -- cgit