From 73e8d5a7b668e3a9700101b2fcd742ed349e0b26 Mon Sep 17 00:00:00 2001 From: eddie-sheffield Date: Mon, 17 Sep 2012 11:10:06 -0400 Subject: 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 --- nova/compute/manager.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'nova') 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() -- cgit