From 0d51778bca2f7eb8a1ba4fb89e0e9a47c73fc466 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Mon, 5 Nov 2012 16:17:41 -0500 Subject: Remove instance_type db lookup in prep_resize. Remove a db read in prep_resize() by grabbing the instance_type data out of the instance dict. The code was unnecessarily looking it up from the db. Part of blueprint no-db-compute. Change-Id: I6e26a8a90f7cfca12426fad2430a0eb73991f42f --- nova/compute/manager.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 642769dfe..442174133 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -1680,12 +1680,7 @@ class ComputeManager(manager.SchedulerDependentManager): msg = _('destination same as source!') raise exception.MigrationError(msg) - # TODO(russellb): no-db-compute: Send the old instance type - # info that is needed via rpc so db access isn't required - # here. - old_instance_type_id = instance['instance_type_id'] - old_instance_type = instance_types.get_instance_type( - old_instance_type_id) + old_instance_type = instance['instance_type'] migration_ref = self.db.migration_create(context.elevated(), {'instance_uuid': instance['uuid'], -- cgit