Move all shelve code paths to BDM objects

At this point only unshelve used direct conductor calls to fetch BDMs so
this patch moves it to objects and fixes tests.

Part of the blueprint: icehouse-objects

Change-Id: I6821222e98bc975fbe618fe922edc41d25f40200
This commit is contained in:
Nikola Dipanov 2014-01-31 09:15:40 +01:00
parent effa12e871
commit 9e11cf0149
2 changed files with 4 additions and 4 deletions

View File

@ -3612,8 +3612,8 @@ class ComputeManager(manager.Manager):
instance.save()
network_info = self._get_instance_nw_info(context, instance)
bdms = self.conductor_api.block_device_mapping_get_all_by_instance(
context, instance, legacy=False)
bdms = block_device_obj.BlockDeviceMappingList.get_by_instance_uuid(
context, instance.uuid)
block_device_info = self._prep_block_device(context, instance, bdms)
scrubbed_keys = self._unshelve_instance_key_scrub(instance)

View File

@ -210,7 +210,7 @@ class ShelveComputeManagerTestCase(test_compute.BaseTestCase):
columns_to_join=['metadata', 'system_metadata'],
).AndReturn((db_instance, db_instance))
self.compute._prep_block_device(self.context, instance,
[]).AndReturn('fake_bdm')
mox.IgnoreArg()).AndReturn('fake_bdm')
db_instance['key_data'] = None
db_instance['auto_disk_config'] = None
self.rt.instance_claim(self.context, instance, limits).AndReturn(
@ -276,7 +276,7 @@ class ShelveComputeManagerTestCase(test_compute.BaseTestCase):
columns_to_join=['metadata', 'system_metadata']
).AndReturn((db_instance, db_instance))
self.compute._prep_block_device(self.context, instance,
[]).AndReturn('fake_bdm')
mox.IgnoreArg()).AndReturn('fake_bdm')
db_instance['key_data'] = None
db_instance['auto_disk_config'] = None
self.rt.instance_claim(self.context, instance, limits).AndReturn(