def rollback(self): # TODO(johngarbutt) need to implement the clean up operation # but this will make sense only once we pull in the compute # calls, since this class currently makes no state changes, # except to call the compute method, that has no matching # rollback call right now. if self._held_allocations: migrate.revert_allocation_for_migration(self.context, self._source_cn, self.instance, self.migration)
def rollback(self): # TODO(johngarbutt) need to implement the clean up operation # but this will make sense only once we pull in the compute # calls, since this class currently makes no state changes, # except to call the compute method, that has no matching # rollback call right now. if self._held_allocations: migrate.revert_allocation_for_migration(self.context, self._source_cn, self.instance, self.migration)
def test_revert_allocation_for_migration_retries_delete( self, mock_da, mock_pa): migration = objects.Migration(uuid=uuids.migration) instance = objects.Instance(uuid=uuids.instance, user_id='fake', project_id='fake', host='host', node='node') source_cn = objects.ComputeNode(uuid=uuids.source) mock_pa.return_value = False migrate.revert_allocation_for_migration(source_cn, instance, migration, mock.sentinel.allocs) mock_pa.assert_has_calls([ mock.call(source_cn.uuid, instance.uuid, mock.sentinel.allocs, instance.project_id, instance.user_id), mock.call(source_cn.uuid, instance.uuid, mock.sentinel.allocs, instance.project_id, instance.user_id), ]) mock_da.assert_called_once_with(migration.uuid)