summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2012-11-05 16:17:41 -0500
committerRussell Bryant <rbryant@redhat.com>2012-11-08 09:34:25 -0500
commit0d51778bca2f7eb8a1ba4fb89e0e9a47c73fc466 (patch)
treefda1bc24fb9405582e17db6cfa5a5342b3adf6ee
parent1a3ac5aa659c2fc9b6b90a0f49caadc7f967ec2b (diff)
downloadnova-0d51778bca2f7eb8a1ba4fb89e0e9a47c73fc466.tar.gz
nova-0d51778bca2f7eb8a1ba4fb89e0e9a47c73fc466.tar.xz
nova-0d51778bca2f7eb8a1ba4fb89e0e9a47c73fc466.zip
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
-rw-r--r--nova/compute/manager.py7
1 files changed, 1 insertions, 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'],