From: Joshua Harlow <harlowja@yahoo-inc.com>
Date: Tue, 17 Dec 2013 23:20:02 +0000 (-0800)
Subject: Add exception logging if flow creation fails
X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=61786a8924fe984ec50c3159dc216bb7533e0f56;p=openstack-build%2Fcinder-build.git

Add exception logging if flow creation fails

If the create_XYZ_flow fails in being created
its useful to log exactly what the error was in
detail (instead of trapping it and only raising
a generic error). The more detailed error shows
what the real problem was during the flows
construction (which usually is some larger
problem).

Change-Id: I9cd6b8e2c6298d8791ba3063be78f9b4c4a7c5d0
---

diff --git a/cinder/scheduler/manager.py b/cinder/scheduler/manager.py
index b4d342717..515ef8c13 100644
--- a/cinder/scheduler/manager.py
+++ b/cinder/scheduler/manager.py
@@ -84,6 +84,7 @@ class SchedulerManager(manager.Manager):
                                                            snapshot_id,
                                                            image_id)
         except Exception:
+            LOG.exception(_("Failed to create scheduler manager volume flow"))
             raise exception.CinderException(
                 _("Failed to create scheduler manager volume flow"))
         flow_engine.run()
diff --git a/cinder/volume/api.py b/cinder/volume/api.py
index 857c107ae..90a41242f 100644
--- a/cinder/volume/api.py
+++ b/cinder/volume/api.py
@@ -167,6 +167,7 @@ class API(base.Base):
                                                      check_volume_az_zone,
                                                      create_what)
         except Exception:
+            LOG.exception(_("Failed to create api volume flow"))
             raise exception.CinderException(
                 _("Failed to create api volume flow"))
 
diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py
index 0c238072a..52ab941d9 100644
--- a/cinder/volume/manager.py
+++ b/cinder/volume/manager.py
@@ -310,6 +310,7 @@ class VolumeManager(manager.SchedulerDependentManager):
                 request_spec=request_spec,
                 filter_properties=filter_properties)
         except Exception:
+            LOG.exception(_("Failed to create manager volume flow"))
             raise exception.CinderException(
                 _("Failed to create manager volume flow"))