diff options
| author | Mark McLoughlin <markmc@redhat.com> | 2012-08-15 14:17:23 +0100 |
|---|---|---|
| committer | Mark McLoughlin <markmc@redhat.com> | 2012-08-15 14:17:23 +0100 |
| commit | 2ba710af4f619a9aa3d4d4e377af01f5c6fe39e9 (patch) | |
| tree | 36f09a5bc7ac62bb5634a630b7be41fde183be92 | |
| parent | 1ef3607239c4bce8a276e420f2b70137b1a1fe2f (diff) | |
| download | nova-2ba710af4f619a9aa3d4d4e377af01f5c6fe39e9.tar.gz nova-2ba710af4f619a9aa3d4d4e377af01f5c6fe39e9.tar.xz nova-2ba710af4f619a9aa3d4d4e377af01f5c6fe39e9.zip | |
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
| -rw-r--r-- | nova/compute/manager.py | 7 |
1 files 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() |
