From 66f1a34cabc26930db2a1afed5a0f5ced4d1c015 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Thu, 1 Nov 2012 11:50:59 -0700 Subject: Fix backwards compat of rpc to compute manager Commit dcabd6159abcdccd99e55495ec005926465007a8 changed compute manager in a way that it will fail to respond to the older 2.X rpc message for reserve_block_device_name. This fixes it by making the volume_id parameter optional. Change-Id: Ia2d353d5b195e5687917ef5f928c0c835ffe3d3a --- nova/compute/manager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 46da52c1a..90ccdf5ff 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -2025,7 +2025,8 @@ class ComputeManager(manager.SchedulerDependentManager): @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id()) @reverts_task_state @wrap_instance_fault - def reserve_block_device_name(self, context, instance, device, volume_id): + def reserve_block_device_name(self, context, instance, device, + volume_id=None): @lockutils.synchronized(instance['uuid'], 'nova-') def do_reserve(): @@ -2034,7 +2035,7 @@ class ComputeManager(manager.SchedulerDependentManager): device) # NOTE(vish): create bdm here to avoid race condition values = {'instance_uuid': instance['uuid'], - 'volume_id': volume_id, + 'volume_id': volume_id or 'reserved', 'device_name': result} self.db.block_device_mapping_create(context, values) return result -- cgit