]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix except in lvm.py
authorJohn Griffith <john.griffith@solidfire.com>
Tue, 27 Aug 2013 00:52:02 +0000 (00:52 +0000)
committerJohn Griffith <john.griffith@solidfire.com>
Tue, 27 Aug 2013 00:55:45 +0000 (00:55 +0000)
Consolidation of brick exceptions into a single
brick exception.py file neglected to updated files
that were using it:
    (see change I577d403f02c2fd0d727d2694776008e1e9791453)

The result is the lvm driver was doing an except on lvm.VolumeGroupNotFound
which didn't exist anymore as it's in brick/exception now.

We still need to clean up exceptions all through here, and this still
isn't handled by service init anyway, but at least with this we are
raising a valid exception.

Change-Id: I588e9ac6548823b291d284f68f6133879bf3dfbf
Fixes: bug 1216122
cinder/volume/drivers/lvm.py

index 6e6ace6256c7db38917985849a536381eff34f61..c4e2794aa748714566f243a24a00128d0a0d6e0b 100644 (file)
@@ -26,6 +26,7 @@ import socket
 
 from oslo.config import cfg
 
+from cinder.brick import exception as brick_exception
 from cinder.brick.iscsi import iscsi
 from cinder.brick.iser import iser
 from cinder.brick.local_dev import lvm as lvm
@@ -84,7 +85,7 @@ class LVMVolumeDriver(driver.VolumeDriver):
                                   root_helper,
                                   lvm_type=self.configuration.lvm_type,
                                   executor=self._execute)
-            except lvm.VolumeGroupNotFound:
+            except brick_exception.VolumeGroupNotFound:
                 message = ("Volume Group %s does not exist" %
                            self.configuration.volume_group)
                 raise exception.VolumeBackendAPIException(data=message)