]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Log initialize_connection error before remove_export
authorEric Harney <eharney@redhat.com>
Tue, 8 Apr 2014 17:55:25 +0000 (13:55 -0400)
committerEric Harney <eharney@redhat.com>
Tue, 8 Apr 2014 17:55:25 +0000 (13:55 -0400)
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

index d9c42bd9b674ec46b318cfecfd2da6bbeef07279..5f6b6f57d00561cc85b2b230d123f6b1e0b02e53 100644 (file)
@@ -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