]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Error message in update_migrated_volume was incorrect
authorJacob Gregor <jgregor@us.ibm.com>
Fri, 4 Sep 2015 21:30:12 +0000 (16:30 -0500)
committerJacob Gregor <jgregor@us.ibm.com>
Fri, 4 Sep 2015 21:30:12 +0000 (16:30 -0500)
If an error was encountered in self.vg.rename_volume the error
message tried to use volume['name'], which is an invalid key.
The invalid key error would then cause the retype/migration to
abort in the middle of the process and leave original and temporary
volume in place. This patch fixes this bug by providing a valid key.

Change-Id: I73e1335c649df41d5167efc3cb4b9af48a5d537d
Closes-bug: #1492462

cinder/volume/drivers/lvm.py

index 6a54eb3c6865a4b6f4527d73db1b4b0abe7c4ef2..d38eeaea8368f6c31c289e3da60e9a9027d052df 100644 (file)
@@ -355,7 +355,7 @@ class LVMVolumeDriver(driver.VolumeDriver):
                 self.vg.rename_volume(current_name, original_volume_name)
             except processutils.ProcessExecutionError:
                 LOG.error(_LE('Unable to rename the logical volume '
-                              'for volume: %s'), volume['name'])
+                              'for volume: %s'), volume['id'])
                 # If the rename fails, _name_id should be set to the new
                 # volume id and provider_location should be set to the
                 # one from the new volume as well.