summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorDan Smith <danms@us.ibm.com>2012-12-07 09:00:04 -0800
committerDan Smith <danms@us.ibm.com>2012-12-07 09:00:04 -0800
commitaa97ba926d5bf6bc81903c5d651ece308e9629c0 (patch)
tree12ca5b0aa38a48c8c4c784e2dd6fd625282cbc13 /nova/compute
parent3c45436cbfe45236e3e6643b80c061c618e3bfa1 (diff)
downloadnova-aa97ba926d5bf6bc81903c5d651ece308e9629c0.tar.gz
nova-aa97ba926d5bf6bc81903c5d651ece308e9629c0.tar.xz
nova-aa97ba926d5bf6bc81903c5d651ece308e9629c0.zip
Use conductor for migration_get()
This patch removes direct database accesses for looking up migrations by id, and instead queries conductor. Related to blueprint no-db-compute Change-Id: Ia7df121971b14b1eb4ce65063246968b3603309d
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/manager.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index fd8dc7d17..f0c0fe961 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -1625,8 +1625,7 @@ class ComputeManager(manager.SchedulerDependentManager):
migration=None, migration_id=None):
"""Destroys the source instance."""
if not migration:
- migration = self.db.migration_get(context.elevated(),
- migration_id)
+ migration = self.conductor_api.migration_get(context, migration_id)
self._notify_about_instance_usage(context, instance,
"resize.confirm.start")
@@ -1662,8 +1661,7 @@ class ComputeManager(manager.SchedulerDependentManager):
"""
if not migration:
- migration = self.db.migration_get(context.elevated(),
- migration_id)
+ migration = self.conductor_api.migration_get(context, migration_id)
# NOTE(comstud): A revert_resize is essentially a resize back to
# the old size, so we need to send a usage event here.
@@ -1706,10 +1704,8 @@ class ComputeManager(manager.SchedulerDependentManager):
in the database.
"""
- elevated = context.elevated()
-
if not migration:
- migration = self.db.migration_get(elevated, migration_id)
+ migration = self.conductor_api.migration_get(context, migration_id)
with self._error_out_instance_on_exception(context, instance['uuid'],
reservations):
@@ -1889,7 +1885,7 @@ class ComputeManager(manager.SchedulerDependentManager):
instance_type=None):
"""Starts the migration of a running instance to another host."""
if not migration:
- migration = self.db.migration_get(context.elevated(), migration_id)
+ migration = self.conductor_api.migration_get(context, migration_id)
with self._error_out_instance_on_exception(context, instance['uuid'],
reservations):
if not instance_type:
@@ -2026,8 +2022,7 @@ class ComputeManager(manager.SchedulerDependentManager):
"""
if not migration:
- migration = self.db.migration_get(context.elevated(),
- migration_id)
+ migration = self.conductor_api.migration_get(context, migration_id)
try:
self._finish_resize(context, instance, migration,
disk_info, image)