Skip to content

Commit 4a285b1

Browse files
committed
Fix check_instance_shared_storage() call
In the RPC 6.0 bump, we re-ordered the data and instance parameters in the client, without changing the order of the caller. This causes us to pass the instance to the virt driver call instead of the data structure, thus failing the check all the time (and barfing a traceback). This just fixes that re-ordering. Since all of our direct testing of this is done using dispatch-by-name, we didn't see a unit test fail because of it, but the error was visible in the logs of an integration run. There is one evacuate test that asserts the ordering is as we expect, which this fixes. Given the time constraints of RC1, I'm considering that to be enough coverage, but we probably need a better test that covers the seam between manager and rpcapi here. Change-Id: Ie7e06776315e5e82e7d320919f1781fa2164398a Closes-Bug: #1921399
1 parent 572ae57 commit 4a285b1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

nova/compute/manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ def _is_instance_storage_shared(self, context, instance, host=None):
794794
if data:
795795
shared_storage = (self.compute_rpcapi.
796796
check_instance_shared_storage(context,
797-
instance, data, host=host))
797+
data, instance=instance, host=host))
798798
except NotImplementedError:
799799
LOG.debug('Hypervisor driver does not support '
800800
'instance shared storage check, '

nova/tests/unit/compute/test_compute.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7654,8 +7654,9 @@ def test_destroy_evacuated_instance_with_disks(self, mock_save,
76547654
mock_get_blk.assert_called_once_with(fake_context, evacuated_instance)
76557655
mock_check_local.assert_called_once_with(fake_context,
76567656
evacuated_instance)
7657-
mock_check.assert_called_once_with(fake_context, evacuated_instance,
7657+
mock_check.assert_called_once_with(fake_context,
76587658
{'filename': 'tmpfilename'},
7659+
instance=evacuated_instance,
76597660
host=None)
76607661
mock_check_clean.assert_called_once_with(fake_context,
76617662
{'filename': 'tmpfilename'})

0 commit comments

Comments
 (0)