From 2ba710af4f619a9aa3d4d4e377af01f5c6fe39e9 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Wed, 15 Aug 2012 14:17:23 +0100 Subject: Remove unnecessary try/finally from snapshot Revert part of 0eb53c0 which reverted part of d8d7100 :-) The idea was that now that @reverts_task_state handles unsetting the task state, we now longer need the explicit exception handling here. However, we still absolutely need to unset task_state on the happy path. Change-Id: I08dd212626886a643f0321780f6d8a30c3a967e6 --- nova/compute/manager.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 1b8115531..10056137c 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -1178,11 +1178,8 @@ class ComputeManager(manager.SchedulerDependentManager): self._notify_about_instance_usage( context, instance, "snapshot.start") - try: - self.driver.snapshot(context, instance, image_id) - finally: - self._instance_update(context, instance['uuid'], - task_state=None) + self.driver.snapshot(context, instance, image_id) + self._instance_update(context, instance['uuid'], task_state=None) if image_type == 'snapshot' and rotation: raise exception.ImageRotationNotAllowed() -- cgit