From ecb8cbe34c16f85cf235b1051e8bf01fdae66f98 Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Wed, 13 Jan 2016 14:27:00 -0800 Subject: [PATCH] Remove "or 'reserved'" condition from reserve_block_device_name This condition was added in 66f1a34cabc26930db2a1afed5a0f5ced4d1c015 in grizzly to fix a regression with the compute 2.x rpc api. As of 91b35b22e753a4eb0c22c004bb12586970a95e11 we require compute rpc api >= 4.0 so the 2.x rpc api compat is no longer a concern. We should remove this condition since it's confusing, especially considering that the block_device_mappings table has no unique constraint yet we try to treat them as unique in most cases. Note that the v2 and v2.1 REST APIs also require that a volumeId is provided when attaching a volume (which is the only API that uses this method), so the volume_id should always be provided and we don't need to worry about this optional case. Apparently there was never a unit test added for this case, so there are no tests to update. Change-Id: I5cde374a2621b22b094d14e357a399a2fb784287 Closes-Bug: #1533871 --- nova/compute/manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nova/compute/manager.py b/nova/compute/manager.py index dd686be1399b..34c8274dae05 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -4635,7 +4635,7 @@ class ComputeManager(manager.Manager): context=context, source_type='volume', destination_type='volume', instance_uuid=instance.uuid, boot_index=None, - volume_id=volume_id or 'reserved', + volume_id=volume_id, device_name=device, guest_format=None, disk_bus=disk_bus, device_type=device_type)