From 0184bb4798dd4660182062fe4099a07e63dd90e8 Mon Sep 17 00:00:00 2001 From: Ildiko Vancsa Date: Wed, 11 Oct 2017 12:56:02 +0200 Subject: [PATCH] Fix connection info refresh for reboot The 'bdms' parameter is not referenced correctly in _get_instance_block_device_info in compute/manager.py which causes the function to call down to the bdm to refresh the connection_info which is not supposed to happen during reboot. The patch fixes to use the optional parameter correctly. Fixes-Bug: #1722771 Change-Id: I5545d0807626b353ca723ab1f125fd1f94bcef2e --- nova/compute/manager.py | 4 ++-- nova/tests/unit/compute/test_compute.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nova/compute/manager.py b/nova/compute/manager.py index ea0bb0b3f949..e63d70380481 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -3042,7 +3042,7 @@ class ComputeManager(manager.Manager): bdms = objects.BlockDeviceMappingList.get_by_instance_uuid( context, instance.uuid) block_device_info = self._get_instance_block_device_info( - context, instance, bdms) + context, instance, bdms=bdms) network_info = self.network_api.get_instance_nw_info(context, instance) @@ -4377,7 +4377,7 @@ class ComputeManager(manager.Manager): bdms = objects.BlockDeviceMappingList.get_by_instance_uuid( context, instance.uuid) block_device_info = self._get_instance_block_device_info( - context, instance, bdms) + context, instance, bdms=bdms) compute_utils.notify_about_instance_action(context, instance, self.host, action=fields.NotificationAction.RESUME, diff --git a/nova/tests/unit/compute/test_compute.py b/nova/tests/unit/compute/test_compute.py index f356d2b2a227..32f8bfd255e1 100644 --- a/nova/tests/unit/compute/test_compute.py +++ b/nova/tests/unit/compute/test_compute.py @@ -3102,7 +3102,7 @@ class ComputeTestCase(BaseTestCase, reboot_type=reboot_type) self.assertEqual(expected_call_info, reboot_call_info) - mock_get_blk.assert_called_once_with(econtext, instance, bdms) + mock_get_blk.assert_called_once_with(econtext, instance, bdms=bdms) mock_get_nw.assert_called_once_with(econtext, instance) mock_notify_usage.assert_has_calls(notify_call_list) mock_notify_action.assert_has_calls(notify_action_call_list)