Merge "Fix resize revert to use non-legacy alloc handling"
This commit is contained in:
commit
c52c2caf97
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user