From: Mate Lakat Date: Wed, 20 Feb 2013 15:34:05 +0000 (+0000) Subject: Fix various exception paths X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=c3c31fcff7717e0112616902780d4c762bd66702;p=openstack-build%2Fcinder-build.git Fix various exception paths 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 --- diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index 4e4f3de91..a810a9331 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -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]