From: Vipin Balachandran Date: Tue, 10 Mar 2015 23:23:02 +0000 (+0530) Subject: VMware: Fix exception logging X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=15ee40e627f236011c9117fa65748fe4f03843d1;p=openstack-build%2Fcinder-build.git VMware: Fix exception logging At some places, logging.exception is called with a formatted string containing info of the current exception. The exception info in the log message is redundant since logging.exception always logs the current exception. Change-Id: I4ec6b3dabf6e0f2c22b06bd65d765eaa453b819d Closes-Bug: #1269345 --- diff --git a/cinder/volume/drivers/vmware/vmdk.py b/cinder/volume/drivers/vmware/vmdk.py index ca555a67f..35af42332 100644 --- a/cinder/volume/drivers/vmware/vmdk.py +++ b/cinder/volume/drivers/vmware/vmdk.py @@ -1222,13 +1222,13 @@ class VMwareEsxVmdkDriver(driver.VolumeDriver): vm_import_spec=vm_import_spec, image_size=image_size) except (exceptions.VimException, - exceptions.VMwareDriverException) as excep: + exceptions.VMwareDriverException): with excutils.save_and_reraise_exception(): - LOG.exception(_LE("Exception in copy_image_to_volume: %s."), - excep) + LOG.exception(_LE("Error occurred while copying image: %(id)s " + "to volume: %(vol)s."), + {'id': image_id, 'vol': volume['name']}) backing = self.volumeops.get_backing(volume['name']) if backing: - LOG.exception(_LE("Deleting the backing: %s"), backing) # delete the backing self.volumeops.delete_backing(backing) @@ -1314,10 +1314,11 @@ class VMwareEsxVmdkDriver(driver.VolumeDriver): context, volume, image_service, image_id, image_size_in_bytes, image_adapter_type, image_disk_type) except (exceptions.VimException, - exceptions.VMwareDriverException) as excep: + exceptions.VMwareDriverException): with excutils.save_and_reraise_exception(): - LOG.exception(_LE("Exception in copying the image to the " - "volume: %s."), excep) + LOG.exception(_LE("Error occurred while copying image: %(id)s " + "to volume: %(vol)s."), + {'id': image_id, 'vol': volume['name']}) LOG.debug("Volume: %(id)s created from image: %(image_id)s.", {'id': volume['id'],