From: Eric Harney Date: Tue, 8 Apr 2014 17:55:25 +0000 (-0400) Subject: Log initialize_connection error before remove_export X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=2ff233a1d14c4f0ff4ffc7df41e1d86df12a250f;p=openstack-build%2Fcinder-build.git Log initialize_connection error before remove_export The way this code is currently structured, if self.driver.remove_export() raises an exception, you see the error message logged for that but the original exception from initialize_connection() never gets logged. Change-Id: I454c73e8fdc88e5a9542369a5bca33f29617f013 --- diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index d9c42bd9b..5f6b6f57d 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -794,10 +794,12 @@ class VolumeManager(manager.SchedulerDependentManager): try: conn_info = self.driver.initialize_connection(volume, connector) except Exception as err: - self.driver.remove_export(context, volume) err_msg = (_('Unable to fetch connection information from ' 'backend: %(err)s') % {'err': err}) LOG.error(err_msg) + + self.driver.remove_export(context, volume) + raise exception.VolumeBackendAPIException(data=err_msg) # Add qos_specs to connection info