]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix various exception paths
authorMate Lakat <mate.lakat@citrix.com>
Wed, 20 Feb 2013 15:34:05 +0000 (15:34 +0000)
committerMate Lakat <mate.lakat@citrix.com>
Thu, 21 Feb 2013 09:51:25 +0000 (09:51 +0000)
Fixes bug 1130723

Some bugs were introduced in https://review.openstack.org/#/c/20514/
this patch fixes the discovered errors. It also removes volume_id
parameters from error messages.

Change-Id: I9ff75482fe2bc13dbb65e7d666035a13a19d5c98

cinder/volume/manager.py

index 4e4f3de91ee462a6a03b6afc29d0709ca4df74e9..a810a9331534b70efe3a6fa2bcb998022b8f5267 100644 (file)
@@ -209,6 +209,7 @@ class VolumeManager(manager.SchedulerDependentManager):
         status = 'available'
         model_update = False
         image_meta = None
+        cloned = False
 
         try:
             vol_name = volume_ref['name']
@@ -306,11 +307,10 @@ class VolumeManager(manager.SchedulerDependentManager):
         self._notify_about_volume_usage(context, volume_ref, "create.end")
         return volume_ref['id']
 
-    def _log_original_error(self, exc_info, volume_id):
+    def _log_original_error(self, exc_info):
         type_, value, tb = exc_info
         LOG.error(_('Error: %s') %
-                  traceback.format_exception(type_, value, tb),
-                  volume_id=volume_id)
+                  traceback.format_exception(type_, value, tb))
 
     def _reschedule_or_reraise(self, context, volume_id, exc_info,
                                snapshot_id, image_id, request_spec,
@@ -335,12 +335,11 @@ class VolumeManager(manager.SchedulerDependentManager):
 
         except Exception:
             rescheduled = False
-            LOG.exception(_("Error trying to reschedule %(volume_id)s"),
-                          volume_id=volume_id)
+            LOG.exception(_("Error trying to reschedule"))
 
         if rescheduled:
             # log the original build error
-            self._log_original_error(exc_info, volume_id)
+            self._log_original_error(exc_info)
         else:
             # not re-scheduling
             raise exc_info[0], exc_info[1], exc_info[2]