]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix failure of source volume deletion in migrate_volume_completion
authorTomoki Sekiyama <tomoki.sekiyama@hds.com>
Sat, 19 Jul 2014 00:36:56 +0000 (20:36 -0400)
committerTomoki Sekiyama <tomoki.sekiyama@hds.com>
Sat, 19 Jul 2014 01:06:34 +0000 (21:06 -0400)
In VolumeManager.migrate_volume_completion(), when volume_status is not
'retyping', status_update is not set. However, status_update is always
referenced as dictionary on volume deletion path, so it fails to delete
migration source volume. This patch fixes the issue.

Change-Id: I06889dae326b9557e044f1712d9f3205bb68a953
Closes-Bug: 1344341

cinder/volume/manager.py

index aad9fe9ad8082b45b861a47089c4d6e740adba72..3719c7262549dbb345d1e5a93ad866724d7c6a06 100644 (file)
@@ -997,7 +997,7 @@ class VolumeManager(manager.SchedulerDependentManager):
 
         # Delete the source volume (if it fails, don't fail the migration)
         try:
-            if status_update['status'] == 'in-use':
+            if status_update and status_update['status'] == 'in-use':
                 self.detach_volume(ctxt, volume_id)
             self.delete_volume(ctxt, volume_id)
         except Exception as ex: