]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Remove a catching exception during delete_volume
authorBertrand Lallau <bertrand.lallau@gmail.com>
Sat, 1 Feb 2014 13:33:33 +0000 (14:33 +0100)
committerBertrand Lallau <bertrand.lallau@gmail.com>
Sat, 1 Feb 2014 14:47:34 +0000 (15:47 +0100)
GlanceMetadataNotFound Exception was catching during
a call to volume_glance_metadata_delete_by_volume().
This exception is never thrown by the implementation.
This catching has been removed.

Change-Id: Ifa15df5d9c4517f75a1a050ff5aa34225f33931b
Closes-Bug: #1274601

cinder/volume/manager.py

index 63813f319da56a6b426b8b6b3a4f8197a9db390b..100cc422c920a3c1fabf312a608c19a02c827984 100644 (file)
@@ -422,13 +422,7 @@ class VolumeManager(manager.SchedulerDependentManager):
             LOG.exception(_("Failed to update usages deleting volume"))
 
         # Delete glance metadata if it exists
-        try:
-            self.db.volume_glance_metadata_delete_by_volume(context, volume_id)
-            LOG.debug(_("volume %s: glance metadata deleted"),
-                      volume_ref['id'])
-        except exception.GlanceMetadataNotFound:
-            LOG.debug(_("no glance metadata found for volume %s"),
-                      volume_ref['id'])
+        self.db.volume_glance_metadata_delete_by_volume(context, volume_id)
 
         self.db.volume_destroy(context, volume_id)
         LOG.info(_("volume %s: deleted successfully"), volume_ref['id'])