Remove dead code from reserve_block_device_name rpcapi

339a97d0f2 added the
isinstance check in Juno and was a shim in the 3.x compute
RPC API.

91b35b22e7 dropped
compute RPC API 3.x support, and removed the shim kwarg
from the compute manager method, so we always get a BDM
object back now and this is dead code, so remove it.

Change-Id: I3a062325df746d577ae5c17c21b2a59ab585ff2d
This commit is contained in:
Matt Riedemann 2016-01-14 12:58:33 -08:00
parent 6cceca70e1
commit a94bbf30dd
2 changed files with 1 additions and 8 deletions

View File

@ -810,11 +810,7 @@ class ComputeAPI(object):
cctxt = self.client.prepare(server=_compute_host(None, instance),
version=version)
volume_bdm = cctxt.call(ctxt, 'reserve_block_device_name', **kw)
if not isinstance(volume_bdm, objects.BlockDeviceMapping):
volume_bdm = objects.BlockDeviceMapping.get_by_volume_and_instance(
ctxt, volume_id, instance.uuid)
return volume_bdm
return cctxt.call(ctxt, 'reserve_block_device_name', **kw)
def backup_instance(self, ctxt, instance, image_id, backup_type,
rotation):

View File

@ -134,9 +134,6 @@ class ComputeRpcAPITestCase(test.NoDBTestCase):
if '_return_value' in kwargs:
rpc_mock.return_value = kwargs.pop('_return_value')
del expected_kwargs['_return_value']
elif 'return_bdm_object' in kwargs:
del kwargs['return_bdm_object']
rpc_mock.return_value = objects_block_dev.BlockDeviceMapping()
elif rpc_method == 'call':
rpc_mock.return_value = 'foo'
else: