]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Add exception handling for copy_volume_to_image()
authorZhengguang--reset-author <zhengguangou@gmail.com>
Tue, 6 May 2014 01:05:34 +0000 (09:05 +0800)
committerZhengguang--reset-author <zhengguangou@gmail.com>
Tue, 6 May 2014 03:57:02 +0000 (11:57 +0800)
commitc08211b19e2b9c38e537e155d11ffced37af0e85
tree04ea3189048f769aa8ea48f6119d75b58ab5a62c
parent6168d361cfbb43d4ef0e045368f04904937a7c09
Add exception handling for copy_volume_to_image()

The method require_driver_initialized occurs exception so that the
method volume_get will be not executed, and the variable 'volume'
will be not defined. In the "finally" code segment, the
volume['instance_uuid'] will get the UnboundLocalError, this patch
gets volume before require_driver_initialized to avoid the above
problem.

Change-Id: Ic8167383eb67c5016c9853da274455e0f202dc4d
Closes-Bug: #1322958
cinder/tests/test_volume.py
cinder/volume/manager.py