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
This commit is contained in:
Dan Smith 2021-03-25 08:12:34 -07:00 committed by Dan Smith
parent 572ae578bb
commit 4a285b1fb9
2 changed files with 3 additions and 2 deletions

View File

@ -794,7 +794,7 @@ class ComputeManager(manager.Manager):
if data:
shared_storage = (self.compute_rpcapi.
check_instance_shared_storage(context,
instance, data, host=host))
data, instance=instance, host=host))
except NotImplementedError:
LOG.debug('Hypervisor driver does not support '
'instance shared storage check, '

View File

@ -7654,8 +7654,9 @@ class ComputeTestCase(BaseTestCase,
mock_get_blk.assert_called_once_with(fake_context, evacuated_instance)
mock_check_local.assert_called_once_with(fake_context,
evacuated_instance)
mock_check.assert_called_once_with(fake_context, evacuated_instance,
mock_check.assert_called_once_with(fake_context,
{'filename': 'tmpfilename'},
instance=evacuated_instance,
host=None)
mock_check_clean.assert_called_once_with(fake_context,
{'filename': 'tmpfilename'})