summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-08-08 11:42:17 +0000
committerGerrit Code Review <review@openstack.org>2018-08-08 11:42:18 +0000
commitc52c2caf97a90de8770e9296d553e0e4a65ac946 (patch)
tree5ebb066bf2bfaa6ffa0e70598b76f738dfed348a
parente8a73c400846b5be0f12a2eea32bd2c5c5aeb370 (diff)
parent3311d579db2482c5d06cd4e245da57333b79a8db (diff)
downloadnova-c52c2caf97a90de8770e9296d553e0e4a65ac946.tar.gz
Merge "Fix resize revert to use non-legacy alloc handling"
-rw-r--r--nova/compute/manager.py5
-rw-r--r--nova/tests/unit/compute/test_compute_mgr.py8
2 files changed, 5 insertions, 8 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index cf6d22b9cd..808da45718 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -3949,9 +3949,8 @@ class ComputeManager(manager.Manager):
# made it past the check above), so we need to check to
# see if the source did migration-based allocation
# accounting
- allocs = (
- self.reportclient.get_allocations_for_consumer_by_provider(
- context, cn_uuid, migration.uuid))
+ allocs = self.reportclient.get_allocations_for_consumer(
+ context, migration.uuid)
if allocs:
# NOTE(danms): The source did migration-based allocation
# accounting, so we should let the source node rejigger
diff --git a/nova/tests/unit/compute/test_compute_mgr.py b/nova/tests/unit/compute/test_compute_mgr.py
index 1ed96e5001..04c584cb10 100644
--- a/nova/tests/unit/compute/test_compute_mgr.py
+++ b/nova/tests/unit/compute/test_compute_mgr.py
@@ -6960,8 +6960,8 @@ class ComputeManagerMigrationTestCase(test.NoDBTestCase):
@mock.patch.object(self.compute, '_get_resource_tracker')
@mock.patch.object(self.compute, 'reportclient')
def doit(new_rules, mock_report, mock_rt):
- a = new_rules and {'allocations': 'fake'} or {}
- ga = mock_report.get_allocations_for_consumer_by_provider
+ a = new_rules and {'fake'} or {}
+ ga = mock_report.get_allocations_for_consumer
ga.return_value = a
self.migration.source_node = 'src'
self.migration.dest_node = 'dst'
@@ -6972,9 +6972,7 @@ class ComputeManagerMigrationTestCase(test.NoDBTestCase):
mock.sentinel.flavor,
'dst')
self.assertFalse(mock_report.delete_allocation_for_instance.called)
- cn_uuid = mock_rt().get_node_uuid.return_value
- ga.assert_called_once_with(self.context, cn_uuid,
- self.migration.uuid)
+ ga.assert_called_once_with(self.context, self.migration.uuid)
old = mock_report.remove_provider_from_instance_allocation
if new_rules: