From 9b8ebe053b0913a0649fb8e76ca7e8b3a6f655dd Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Thu, 26 Sep 2019 13:33:23 +0300 Subject: [PATCH] Pass missing arg to "migrate_instance_finish" This method now accepts a mapping between port ids and resource providers as per I220fa02ee916728e241503084b14984bab4b0c3b. We'll need to figure how exactly should this dict look like. Meanwhile, we'll just pass "None", which Nova seems to accept for backwards compatibility reasons. This is a temporary workaround meant to unblock the gate. It will have to be properly handled by the time we release Ussuri, otherwise we won't be able to support port QoS. Change-Id: I878eab9615a76edab0f8ae5bb0d16652baae473a Partial-Bug: #1845480 (cherry picked from commit 40bd35fcc2d9aecba490a88230f9e7302e6d59c1) --- compute_hyperv/nova/cluster/clusterops.py | 4 +++- compute_hyperv/tests/unit/cluster/test_clusterops.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/compute_hyperv/nova/cluster/clusterops.py b/compute_hyperv/nova/cluster/clusterops.py index 70055ca6..fe051dfd 100644 --- a/compute_hyperv/nova/cluster/clusterops.py +++ b/compute_hyperv/nova/cluster/clusterops.py @@ -224,8 +224,10 @@ class ClusterOps(object): self._context, instance, migration) self._network_api.setup_networks_on_host( self._context, instance, self._this_node) + # TODO(lpetrut): provide the actual port provider mappings. self._network_api.migrate_instance_finish( - self._context, instance, migration) + self._context, instance, migration, + provider_mappings=None) self._network_api.setup_networks_on_host( self._context, instance, self._this_node) self._network_api.setup_networks_on_host( diff --git a/compute_hyperv/tests/unit/cluster/test_clusterops.py b/compute_hyperv/tests/unit/cluster/test_clusterops.py index 1b669acd..eab69aac 100644 --- a/compute_hyperv/tests/unit/cluster/test_clusterops.py +++ b/compute_hyperv/tests/unit/cluster/test_clusterops.py @@ -330,7 +330,8 @@ class ClusterOpsTestCase(test_base.HyperVBaseTestCase): mock_network_api.migrate_instance_start.assert_called_once_with( self.clusterops._context, mock_instance, fake_migration) mock_network_api.migrate_instance_finish.assert_called_once_with( - self.clusterops._context, mock_instance, fake_migration) + self.clusterops._context, mock_instance, fake_migration, + provider_mappings=None) @mock.patch.object(objects.Instance, 'get_by_uuid') def test_get_instance_by_name(self, mock_get_by_uuid):