From 8cc263e30e992b5b307552f150569871e3fd58fc Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Tue, 23 Dec 2014 21:28:53 +0800 Subject: [PATCH] Added Fix_borked_StorPool_driver.patch Rewritten-From: 16962a7055c641eed927fa853b3d5a9b9e14a40d --- xenial/debian/changelog | 1 + .../patches/Fix_borked_StorPool_driver.patch | 59 +++++++++++++++++++ xenial/debian/patches/series | 1 + 3 files changed, 61 insertions(+) create mode 100644 xenial/debian/patches/Fix_borked_StorPool_driver.patch diff --git a/xenial/debian/changelog b/xenial/debian/changelog index 2201bbe85..f13b5c29f 100644 --- a/xenial/debian/changelog +++ b/xenial/debian/changelog @@ -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 Tue, 23 Dec 2014 15:21:52 +0800 diff --git a/xenial/debian/patches/Fix_borked_StorPool_driver.patch b/xenial/debian/patches/Fix_borked_StorPool_driver.patch new file mode 100644 index 000000000..8fd0f600c --- /dev/null +++ b/xenial/debian/patches/Fix_borked_StorPool_driver.patch @@ -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 +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""" diff --git a/xenial/debian/patches/series b/xenial/debian/patches/series index 25c0f244e..b49128c16 100644 --- a/xenial/debian/patches/series +++ b/xenial/debian/patches/series @@ -1 +1,2 @@ install-missing-files.patch +Fix_borked_StorPool_driver.patch -- 2.45.2