Merge "Fix resize revert to use non-legacy alloc handling"

This commit is contained in:
Zuul 2018-08-08 11:42:17 +00:00 committed by Gerrit Code Review
commit c52c2caf97
2 changed files with 5 additions and 8 deletions

View File

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

View File

@ -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: