summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authoreddie-sheffield <eddie.sheffield@rackspace.com>2012-09-17 11:10:06 -0400
committereddie-sheffield <eddie.sheffield@rackspace.com>2012-09-17 16:56:04 -0400
commit73e8d5a7b668e3a9700101b2fcd742ed349e0b26 (patch)
tree5febb5b4b72626ec563da8ebeca3a62c42edce9a /nova
parent725c99b2a9a05c905b6ff9455d47917c39be9f57 (diff)
Reset the task state after backup done.
The compute manager needs to reset the task state after a backup is complete. However it was only correctly reseting after a snapshot due to the current expected state being hardcoded. Now looks for the correct expected state depending on whether a backup or snapshot was being executed. Fixes bug 1051069 Change-Id: Ie91f7745b98232370be6c99d318a8033a93cc50c
Diffstat (limited to 'nova')
-rw-r--r--nova/compute/manager.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 2d5baafcf..2b9a9a521 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -1149,8 +1149,15 @@ class ComputeManager(manager.SchedulerDependentManager):
context, instance, "snapshot.start")
self.driver.snapshot(context, instance, image_id)
+
+ if image_type == 'snapshot':
+ expected_task_state = task_states.IMAGE_SNAPSHOT
+
+ elif image_type == 'backup':
+ expected_task_state = task_states.IMAGE_BACKUP
+
self._instance_update(context, instance['uuid'], task_state=None,
- expected_task_state=task_states.IMAGE_SNAPSHOT)
+ expected_task_state=expected_task_state)
if image_type == 'snapshot' and rotation:
raise exception.ImageRotationNotAllowed()