From 2ff233a1d14c4f0ff4ffc7df41e1d86df12a250f Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Tue, 8 Apr 2014 13:55:25 -0400 Subject: [PATCH] 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 --- cinder/volume/manager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.45.2