Update the StorPool Cinder patches
Catch up with the upstream removal of the use of the Python
"six" library from the StorPool driver.
Change-Id: If8a5d3dcac2a27473f87f57b6802b44dc651ea29
diff --git a/patches/openstack/cinder/sep-sp-iscsi.patch b/patches/openstack/cinder/sep-sp-iscsi.patch
index 8c07013..085e9e8 100644
--- a/patches/openstack/cinder/sep-sp-iscsi.patch
+++ b/patches/openstack/cinder/sep-sp-iscsi.patch
@@ -1,7 +1,7 @@
-From 15fe701cfc698a2d8d3ce12ba33983a42e50411e Mon Sep 17 00:00:00 2001
+From 809a5c657faa1b1cbe26a7ae0aad77840300498f Mon Sep 17 00:00:00 2001
From: Peter Penchev <openstack-dev@storpool.com>
Date: Mon, 12 Mar 2018 12:00:10 +0200
-Subject: [PATCH 10/10] Add iSCSI export support to the StorPool driver
+Subject: [PATCH 9/9] Add iSCSI export support to the StorPool driver
Add four new driver options:
- iscsi_cinder_volume: use StorPool iSCSI attachments whenever
@@ -33,10 +33,10 @@
create mode 100644 releasenotes/notes/storpool-iscsi-cefcfe590a07c5c7.yaml
diff --git a/cinder/tests/unit/volume/drivers/test_storpool.py b/cinder/tests/unit/volume/drivers/test_storpool.py
-index 95a1ffffd..2b76e7c75 100644
+index 94074d218..781d1a0ef 100644
--- a/cinder/tests/unit/volume/drivers/test_storpool.py
+++ b/cinder/tests/unit/volume/drivers/test_storpool.py
-@@ -14,15 +14,25 @@
+@@ -14,14 +14,24 @@
# under the License.
@@ -51,7 +51,6 @@
import ddt
from oslo_utils import units
- import six
+if TYPE_CHECKING:
+ if sys.version_info >= (3, 11):
@@ -62,7 +61,7 @@
fakeStorPool = mock.Mock()
fakeStorPool.spopenstack = mock.Mock()
-@@ -32,12 +42,21 @@ fakeStorPool.sptypes = mock.Mock()
+@@ -31,12 +41,21 @@ fakeStorPool.sptypes = mock.Mock()
sys.modules['storpool'] = fakeStorPool
@@ -84,7 +83,7 @@
volume_types = {
1: {},
2: {'storpool_template': 'ssd'},
-@@ -71,6 +90,10 @@ def snapshotName(vtype, vid):
+@@ -70,6 +89,10 @@ def snapshotName(vtype, vid):
return 'os--snap--{t}--{id}'.format(t=vtype, id=vid)
@@ -95,7 +94,7 @@
class MockDisk(object):
def __init__(self, diskId):
self.id = diskId
-@@ -181,6 +204,273 @@ def MockVolumeUpdateDesc(size):
+@@ -180,6 +203,273 @@ def MockVolumeUpdateDesc(size):
return {'size': size}
@@ -369,7 +368,7 @@
def MockSPConfig(section = 's01'):
res = {}
m = re.match('^s0*([A-Za-z0-9]+)$', section)
-@@ -222,7 +512,15 @@ class StorPoolTestCase(test.TestCase):
+@@ -221,7 +511,15 @@ class StorPoolTestCase(test.TestCase):
self.cfg.volume_backend_name = 'storpool_test'
self.cfg.storpool_template = None
self.cfg.storpool_replication = 3
@@ -385,7 +384,7 @@
mock_exec = mock.Mock()
mock_exec.return_value = ('', '')
-@@ -231,7 +529,7 @@ class StorPoolTestCase(test.TestCase):
+@@ -230,7 +528,7 @@ class StorPoolTestCase(test.TestCase):
self.driver.check_for_setup_error()
@ddt.data(
@@ -394,7 +393,7 @@
({'no-host': None}, KeyError),
({'host': 'sbad'}, driver.StorPoolConfigurationInvalid),
({'host': 's01'}, None),
-@@ -247,7 +545,7 @@ class StorPoolTestCase(test.TestCase):
+@@ -246,7 +544,7 @@ class StorPoolTestCase(test.TestCase):
conn)
@ddt.data(
@@ -403,7 +402,7 @@
({'no-host': None}, KeyError),
({'host': 'sbad'}, driver.StorPoolConfigurationInvalid),
)
-@@ -286,7 +584,7 @@ class StorPoolTestCase(test.TestCase):
+@@ -285,7 +583,7 @@ class StorPoolTestCase(test.TestCase):
self.assertEqual(21, pool['total_capacity_gb'])
self.assertEqual(5, int(pool['free_capacity_gb']))
@@ -412,7 +411,7 @@
self.assertFalse(pool['QoS_support'])
self.assertFalse(pool['thick_provisioning_support'])
self.assertTrue(pool['thin_provisioning_support'])
-@@ -644,3 +942,136 @@ class StorPoolTestCase(test.TestCase):
+@@ -641,3 +939,136 @@ class StorPoolTestCase(test.TestCase):
self.driver.get_pool({
'volume_type': volume_type
}))
@@ -550,7 +549,7 @@
+ volumeName(fconst.VOLUME_ID),
+ )
diff --git a/cinder/volume/drivers/storpool.py b/cinder/volume/drivers/storpool.py
-index b15a201c3..d8c420a66 100644
+index caa0ce06e..cec7589f2 100644
--- a/cinder/volume/drivers/storpool.py
+++ b/cinder/volume/drivers/storpool.py
@@ -15,6 +15,7 @@
@@ -561,7 +560,7 @@
import platform
from oslo_config import cfg
-@@ -44,6 +45,31 @@ if storpool:
+@@ -43,6 +44,31 @@ if storpool:
storpool_opts = [
@@ -593,7 +592,7 @@
cfg.StrOpt('storpool_template',
default=None,
help='The StorPool template for volumes with no type.'),
-@@ -105,6 +131,7 @@ class StorPoolDriver(driver.VolumeDriver):
+@@ -104,6 +130,7 @@ class StorPoolDriver(driver.VolumeDriver):
self._ourId = None
self._ourIdInt = None
self._attach = None
@@ -601,7 +600,7 @@
@staticmethod
def get_driver_options():
-@@ -162,10 +189,326 @@ class StorPoolDriver(driver.VolumeDriver):
+@@ -161,10 +188,326 @@ class StorPoolDriver(driver.VolumeDriver):
raise StorPoolConfigurationInvalid(
section=hostname, param='SP_OURID', error=e)
@@ -928,7 +927,7 @@
return {'driver_volume_type': 'storpool',
'data': {
'client_id': self._storpool_client_id(connector),
-@@ -174,6 +517,9 @@ class StorPoolDriver(driver.VolumeDriver):
+@@ -173,6 +516,9 @@ class StorPoolDriver(driver.VolumeDriver):
}}
def terminate_connection(self, volume, connector, **kwargs):
@@ -938,7 +937,7 @@
pass
def create_snapshot(self, snapshot):
-@@ -275,11 +621,20 @@ class StorPoolDriver(driver.VolumeDriver):
+@@ -274,11 +620,20 @@ class StorPoolDriver(driver.VolumeDriver):
)
def create_export(self, context, volume, connector):
@@ -960,7 +959,7 @@
def delete_volume(self, volume):
name = self._attach.volumeName(volume['id'])
try:
-@@ -316,6 +671,17 @@ class StorPoolDriver(driver.VolumeDriver):
+@@ -315,6 +670,17 @@ class StorPoolDriver(driver.VolumeDriver):
LOG.error("StorPoolDriver API initialization failed: %s", e)
raise
@@ -978,7 +977,7 @@
def _update_volume_stats(self):
try:
dl = self._attach.api().disksList()
-@@ -341,7 +707,7 @@ class StorPoolDriver(driver.VolumeDriver):
+@@ -340,7 +706,7 @@ class StorPoolDriver(driver.VolumeDriver):
'total_capacity_gb': total / units.Gi,
'free_capacity_gb': free / units.Gi,
'reserved_percentage': 0,
@@ -987,7 +986,7 @@
'QoS_support': False,
'thick_provisioning_support': False,
'thin_provisioning_support': True,
-@@ -360,7 +726,9 @@ class StorPoolDriver(driver.VolumeDriver):
+@@ -359,7 +725,9 @@ class StorPoolDriver(driver.VolumeDriver):
'volume_backend_name') or 'storpool',
'vendor_name': 'StorPool',
'driver_version': self.VERSION,
@@ -1105,5 +1104,5 @@
+ ``iscsi_export_to`` is set to ``*`, that is, all StorPool volumes will be
+ exported via iSCSI to all initiators.
--
-2.42.0
+2.43.0