Browse Source

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
changes/26/783026/2 23.0.0.0rc1
Dan Smith 4 months ago
committed by Dan Smith
parent
commit
4a285b1fb9
  1. 2
      nova/compute/manager.py
  2. 3
      nova/tests/unit/compute/test_compute.py

2
nova/compute/manager.py

@ -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, '

3
nova/tests/unit/compute/test_compute.py

@ -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'})

Loading…
Cancel
Save