From 1945b82ff5ac30fad1c94849e86c4c3b5d4a28e1 Mon Sep 17 00:00:00 2001 From: Tomoki Sekiyama Date: Fri, 18 Jul 2014 20:36:56 -0400 Subject: [PATCH] Fix failure of source volume deletion in migrate_volume_completion 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index aad9fe9ad80..3719c726254 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -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: