summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorChris Behrens <cbehrens@codestud.com>2012-11-14 17:25:43 +0000
committerChris Behrens <cbehrens@codestud.com>2012-11-14 17:30:17 +0000
commit9fdf7552779d518af9cda4e366bf81fddb0cb6f2 (patch)
tree8a8eb929a580d62ed2347253af201a754684ae46 /nova/compute
parent16266a4afbfdbed5e3c2334e03e2c9c43b133020 (diff)
downloadnova-9fdf7552779d518af9cda4e366bf81fddb0cb6f2.tar.gz
nova-9fdf7552779d518af9cda4e366bf81fddb0cb6f2.tar.xz
nova-9fdf7552779d518af9cda4e366bf81fddb0cb6f2.zip
Make sure instance data is always refreshed
Fixes bug 1078793 When updating an instance's instance_type_id, the 'instance_type' joined to the instance is not updated. This updates that. A DB API test is added that failed before and passes now. Also: Some cases of passing stale instance data within resize_instance() and finish_resize() were found and addressed. Change-Id: If335cc286a71597d3100425080e51c75aeec7a50
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/manager.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index be20c7a40..a5084d6fe 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -1837,9 +1837,9 @@ class ComputeManager(manager.SchedulerDependentManager):
migration['id'],
{'status': 'migrating'})
- self._instance_update(context, instance['uuid'],
- task_state=task_states.RESIZE_MIGRATING,
- expected_task_state=task_states.RESIZE_PREP)
+ instance = self._instance_update(context, instance['uuid'],
+ task_state=task_states.RESIZE_MIGRATING,
+ expected_task_state=task_states.RESIZE_PREP)
self._notify_about_instance_usage(
context, instance, "resize.start", network_info=network_info)
@@ -1861,11 +1861,11 @@ class ComputeManager(manager.SchedulerDependentManager):
migration['id'],
{'status': 'post-migrating'})
- self._instance_update(context, instance['uuid'],
- host=migration['dest_compute'],
- task_state=task_states.RESIZE_MIGRATED,
- expected_task_state=task_states.
- RESIZE_MIGRATING)
+ instance = self._instance_update(context, instance['uuid'],
+ host=migration['dest_compute'],
+ task_state=task_states.RESIZE_MIGRATED,
+ expected_task_state=task_states.
+ RESIZE_MIGRATING)
self.compute_rpcapi.finish_resize(context, instance,
migration, image, disk_info,
@@ -1910,7 +1910,7 @@ class ComputeManager(manager.SchedulerDependentManager):
network_info = self._get_instance_nw_info(context, instance)
- self._instance_update(context, instance['uuid'],
+ instance = self._instance_update(context, instance['uuid'],
task_state=task_states.RESIZE_FINISH,
expected_task_state=task_states.RESIZE_MIGRATED)