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
This commit is contained in:
Tomoki Sekiyama 2014-07-18 20:36:56 -04:00
parent edcc9fd977
commit 1945b82ff5
1 changed files with 1 additions and 1 deletions

View 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: