-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding user_current_vol-url patch for the Cinder Queens release
- Loading branch information
1 parent
4c6b0b4
commit 3fea04b
Showing
4 changed files
with
161 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
diff --git a/cinder/volume/drivers/quobyte.py b/cinder/volume/drivers/quobyte.py | ||
index ab89a1fd6..877b71156 100644 | ||
--- a/cinder/volume/drivers/quobyte.py | ||
+++ b/cinder/volume/drivers/quobyte.py | ||
@@ -32,7 +32,7 @@ from cinder import utils | ||
from cinder.volume import configuration | ||
from cinder.volume.drivers import remotefs as remotefs_drv | ||
|
||
-VERSION = '1.1.7' | ||
+VERSION = '1.1.7p' | ||
|
||
LOG = logging.getLogger(__name__) | ||
|
||
@@ -88,6 +88,7 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed): | ||
1.1.5 - Enables extension of volumes with snapshots | ||
1.1.6 - Optimizes volume creation | ||
1.1.7 - Support fuse subtype based Quobyte mount validation | ||
+ 1.1.7p - Patched out of tree | ||
|
||
""" | ||
|
||
@@ -111,6 +112,13 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed): | ||
self._execute('fallocate', '-l', '%sG' % size, | ||
path, run_as_root=self._execute_as_root) | ||
|
||
+ def _strip_qb_protocol(self, url): | ||
+ # Strip quobyte:// from the URL | ||
+ protocol = self.driver_volume_type + "://" | ||
+ if url.startswith(protocol): | ||
+ return url[len(protocol):] | ||
+ return url | ||
+ | ||
def do_setup(self, context): | ||
"""Any initialization the volume driver does while starting.""" | ||
super(QuobyteDriver, self).do_setup(context) | ||
@@ -376,12 +384,7 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed): | ||
""" | ||
self.shares = {} | ||
|
||
- url = self.configuration.quobyte_volume_url | ||
- | ||
- # Strip quobyte:// from the URL | ||
- protocol = self.driver_volume_type + "://" | ||
- if url.startswith(protocol): | ||
- url = url[len(protocol):] | ||
+ url = self._strip_qb_protocol(self.configuration.quobyte_volume_url) | ||
|
||
self.shares[url] = None # None = No extra mount options. | ||
|
||
@@ -393,7 +396,10 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed): | ||
:param quobyte_volume: string | ||
""" | ||
mount_path = self._get_mount_point_for_share(quobyte_volume) | ||
- self._mount_quobyte(quobyte_volume, mount_path, ensure=True) | ||
+ # NOTE(kaisers): Always use the currently configured volume url | ||
+ self._mount_quobyte( | ||
+ self._strip_qb_protocol(self.configuration.quobyte_volume_url), | ||
+ mount_path, ensure=True) | ||
|
||
@utils.synchronized('quobyte_ensure', external=False) | ||
def _ensure_shares_mounted(self): |
74 changes: 74 additions & 0 deletions
74
use_current_vol-url/Queens/use_current_vol-url_full_source.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
diff --git a/cinder/tests/unit/volume/drivers/test_quobyte.py b/cinder/tests/unit/volume/drivers/test_quobyte.py | ||
index ecec8eb68..5475eea40 100644 | ||
--- a/cinder/tests/unit/volume/drivers/test_quobyte.py | ||
+++ b/cinder/tests/unit/volume/drivers/test_quobyte.py | ||
@@ -313,7 +313,7 @@ class QuobyteDriverTestCase(test.TestCase): | ||
mock_get_mount_point.assert_called_once_with( | ||
self.TEST_QUOBYTE_VOLUME) | ||
mock_mount.assert_called_once_with( | ||
- self.TEST_QUOBYTE_VOLUME, | ||
+ self.TEST_QUOBYTE_VOLUME_WITHOUT_PROTOCOL, | ||
mock_get_mount_point.return_value, | ||
ensure=True) | ||
|
||
diff --git a/cinder/volume/drivers/quobyte.py b/cinder/volume/drivers/quobyte.py | ||
index ab89a1fd6..877b71156 100644 | ||
--- a/cinder/volume/drivers/quobyte.py | ||
+++ b/cinder/volume/drivers/quobyte.py | ||
@@ -32,7 +32,7 @@ from cinder import utils | ||
from cinder.volume import configuration | ||
from cinder.volume.drivers import remotefs as remotefs_drv | ||
|
||
-VERSION = '1.1.7' | ||
+VERSION = '1.1.7p' | ||
|
||
LOG = logging.getLogger(__name__) | ||
|
||
@@ -88,6 +88,7 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed): | ||
1.1.5 - Enables extension of volumes with snapshots | ||
1.1.6 - Optimizes volume creation | ||
1.1.7 - Support fuse subtype based Quobyte mount validation | ||
+ 1.1.7p - Patched out of tree | ||
|
||
""" | ||
|
||
@@ -111,6 +112,13 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed): | ||
self._execute('fallocate', '-l', '%sG' % size, | ||
path, run_as_root=self._execute_as_root) | ||
|
||
+ def _strip_qb_protocol(self, url): | ||
+ # Strip quobyte:// from the URL | ||
+ protocol = self.driver_volume_type + "://" | ||
+ if url.startswith(protocol): | ||
+ return url[len(protocol):] | ||
+ return url | ||
+ | ||
def do_setup(self, context): | ||
"""Any initialization the volume driver does while starting.""" | ||
super(QuobyteDriver, self).do_setup(context) | ||
@@ -376,12 +384,7 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed): | ||
""" | ||
self.shares = {} | ||
|
||
- url = self.configuration.quobyte_volume_url | ||
- | ||
- # Strip quobyte:// from the URL | ||
- protocol = self.driver_volume_type + "://" | ||
- if url.startswith(protocol): | ||
- url = url[len(protocol):] | ||
+ url = self._strip_qb_protocol(self.configuration.quobyte_volume_url) | ||
|
||
self.shares[url] = None # None = No extra mount options. | ||
|
||
@@ -393,7 +396,10 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed): | ||
:param quobyte_volume: string | ||
""" | ||
mount_path = self._get_mount_point_for_share(quobyte_volume) | ||
- self._mount_quobyte(quobyte_volume, mount_path, ensure=True) | ||
+ # NOTE(kaisers): Always use the currently configured volume url | ||
+ self._mount_quobyte( | ||
+ self._strip_qb_protocol(self.configuration.quobyte_volume_url), | ||
+ mount_path, ensure=True) | ||
|
||
@utils.synchronized('quobyte_ensure', external=False) | ||
def _ensure_shares_mounted(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
## use_current_vol-url patch | ||
|
||
This patch fixes the Cinder bug [1828993](https://bugs.launchpad.net/cinder/+bug/1828993) with patch [659265](https://review.opendev.org/#/c/659265/), thus ensuring always the currently configured quobyte_volume_url | ||
is used in the Cinder Quobyte driver. | ||
|
||
This patch applies to stripped packaged installations as well as full source tree installations. Slightly different patch commands are used (see below). | ||
|
||
### Usage | ||
|
||
This patch can be applied by navigating to the Cinder project root directory. For stripped packaged installations please run: | ||
|
||
patch -p2 < /path/to/patchfile | ||
|
||
For full source tree installations please run: | ||
|
||
patch -p1 < /path/to/patchfile |