summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Smith <dansmith@redhat.com>2021-03-25 08:12:34 -0700
committerDan Smith <dms@danplanet.com>2021-03-25 22:39:17 +0000
commit4a285b1fb90bd6ea00d4423f8d72116bfb4af44b (patch)
tree989ce0d412919eb8431c013524789989bd687811
parent572ae578bb228cd2dd62608c2e601af49f95fbbb (diff)
downloadnova-23.0.0.0rc1.tar.gz
Fix check_instance_shared_storage() call23.0.0.0rc1
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
-rw-r--r--nova/compute/manager.py2
-rw-r--r--nova/tests/unit/compute/test_compute.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index f0614962f3..8e7b888559 100644
--- a/nova/compute/manager.py
+++ b/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, '
diff --git a/nova/tests/unit/compute/test_compute.py b/nova/tests/unit/compute/test_compute.py
index 02bcbd8f31..67d459b645 100644
--- a/nova/tests/unit/compute/test_compute.py
+++ b/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'})