]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Added Fix_borked_StorPool_driver.patch
authorThomas Goirand <thomas@goirand.fr>
Tue, 23 Dec 2014 13:28:53 +0000 (21:28 +0800)
committerThomas Goirand <thomas@goirand.fr>
Tue, 23 Dec 2014 13:28:53 +0000 (21:28 +0800)
debian/changelog
debian/patches/Fix_borked_StorPool_driver.patch [new file with mode: 0644]
debian/patches/series

index 2201bbe85701a0aaf4b592e2ff979f1365f515dc..f13b5c29ffb84e6eaad63cc5f6f6cae16e33337c 100644 (file)
@@ -3,6 +3,7 @@ cinder (2015.1~b1-1) UNRELEASED; urgency=medium
   * New upstream release.
   * Updated (build-)depends for this release.
   * Now generates cinder.conf on the fly.
+  * Added Fix_borked_StorPool_driver.patch
 
  -- Thomas Goirand <zigo@debian.org>  Tue, 23 Dec 2014 15:21:52 +0800
 
diff --git a/debian/patches/Fix_borked_StorPool_driver.patch b/debian/patches/Fix_borked_StorPool_driver.patch
new file mode 100644 (file)
index 0000000..8fd0f60
--- /dev/null
@@ -0,0 +1,59 @@
+Subject: Fix borked StorPool driver
+ The newly added StorPool driver has a number of issues; It imports it's own
+ 3'rd party libs which are not in the requirements file, it declares conf
+ options but never registers them, and as a result of these two things it break
+ the ability to generate a configuration file.
+ .
+ This patch adds a try_import around the import storpool calls like we do in
+ other drivers, and it registers the config options properly.
+Author: John Griffith <john.griffith8@gmail.com>
+Date: Tue, 23 Dec 2014 00:05:01 +0000 (-0700)
+X-Git-Url: https://review.openstack.org/gitweb?p=openstack%2Fcinder.git;a=commitdiff_plain;h=b7e7d13df12d809e6433a74a5991d2930aa15904
+Bug-Ubuntu: 1405023
+Bug-Ubuntu: 1405022
+Bug-Ubuntu: 1405016
+Change-Id: I61340ab7c5abcdc21dbb12cf0693da036e69e90c
+Origin: upstream, https://review.openstack.org/#/c/143570/
+Last-Update: 2014-12-23
+
+diff --git a/cinder/volume/drivers/storpool.py b/cinder/volume/drivers/storpool.py
+index f8cc49c..2f1db2a 100644
+--- a/cinder/volume/drivers/storpool.py
++++ b/cinder/volume/drivers/storpool.py
+@@ -18,6 +18,7 @@
+ from __future__ import absolute_import
+ from oslo.config import cfg
++from oslo.utils import importutils
+ from oslo.utils import units
+ import six
+@@ -29,9 +30,11 @@ from cinder.volume import volume_types
+ LOG = logging.getLogger(__name__)
+-from storpool import spapi
+-from storpool import spopenstack
+-from storpool import sptypes
++storpool = importutils.try_import('storpool')
++if storpool:
++    from storpool import spapi
++    from storpool import spopenstack
++    from storpool import sptypes
+ storpool_opts = [
+@@ -43,9 +46,12 @@ storpool_opts = [
+                help='The default StorPool chain replication value.  '
+                     'Used when creating a volume with no specified type if '
+                     'storpool_template is not set.  Also used for calculating '
+-                    'the apparent free space reported in the stats.')
++                    'the apparent free space reported in the stats.'),
+ ]
++CONF = cfg.CONF
++CONF.register_opts(storpool_opts)
++
+ class StorPoolDriver(driver.VolumeDriver):
+     """The StorPool block device driver using the StorPool API"""
index 25c0f244e6c3528dd5e85c9e11d2537f261ba6ad..b49128c16e79258503791e73e73b9ca206a7887e 100644 (file)
@@ -1 +1,2 @@
 install-missing-files.patch
+Fix_borked_StorPool_driver.patch