]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Print driver exception on retype
authorAvishay Traeger <avishay@il.ibm.com>
Sun, 12 Jan 2014 13:43:34 +0000 (15:43 +0200)
committerAvishay Traeger <avishay@il.ibm.com>
Sun, 12 Jan 2014 13:43:34 +0000 (15:43 +0200)
If the driver raises an exception, make sure it is printed. Also change
the logging level from info to error because an exception should not be
thrown under normal conditions.

Change-Id: I003959c3f7c7667124ef61911587012fd4e1d667
Closes-Bug: #1268294

cinder/volume/manager.py

index d95b0b0e87ef5ff9ad9cbb31bfb8a2469d76792f..fdb3f7e8bab0bd79fa758afadf00e428b3f6141e 100644 (file)
@@ -1101,11 +1101,12 @@ class VolumeManager(manager.SchedulerDependentManager):
                                              diff, host)
                 if retyped:
                     LOG.info(_("Volume %s: retyped succesfully"), volume_id)
-            except Exception:
+            except Exception as ex:
                 retyped = False
-                LOG.info(_("Volume %s: driver error when trying to retype, "
-                           "falling back to generic mechanism."),
-                         volume_ref['id'])
+                LOG.error(_("Volume %s: driver error when trying to retype, "
+                            "falling back to generic mechanism."),
+                          volume_ref['id'])
+                LOG.exception(ex)
 
         # We could not change the type, so we need to migrate the volume, where
         # the destination volume will be of the new type