Browse Source

Merge "[Glusterfs] Fix delete share, Couldn't find the 'gluster_used_vols'"

tags/11.0.0.0rc1
Zuul 2 weeks ago
committed by Gerrit Code Review
parent
commit
5f433b59ba
3 changed files with 13 additions and 0 deletions
  1. +4
    -0
      manila/share/drivers/glusterfs/layout_volume.py
  2. +2
    -0
      manila/tests/share/drivers/glusterfs/test_layout_volume.py
  3. +7
    -0
      releasenotes/notes/bug-1894362-fix-Glusterfs-del-share-3c8467e1d9f0c6e4.yaml

+ 4
- 0
manila/share/drivers/glusterfs/layout_volume.py View File

@@ -435,6 +435,10 @@ class GlusterfsVolumeMappedLayout(layout.GlusterfsShareLayoutBase):
gmgr.set_vol_option(USER_MANILA_SHARE, 'NONE')
gmgr.set_vol_option('nfs.disable', 'on')

# When deleting the share instance, we need to
# update'self.gluster_used_vols' again
self.gluster_used_vols = set()
self.gluster_used_vols.add(gmgr.qualified)
self._push_gluster_vol(gmgr.qualified)
except exception.GlusterfsException:
msg = ("Error during delete_share request for "


+ 2
- 0
manila/tests/share/drivers/glusterfs/test_layout_volume.py View File

@@ -587,6 +587,7 @@ class GlusterfsVolumeMappedLayoutTestCase(test.TestCase):
gmgr1 = gmgr(self.glusterfs_target1, self._execute, None, None)
gmgr1.set_vol_option = mock.Mock()
gmgr1.get_vol_option = mock.Mock(return_value=clone_of)
new_vol_addr = self.glusterfs_target1
self.mock_object(self._layout, '_glustermanager',
mock.Mock(return_value=gmgr1))
self._layout.gluster_used_vols = set([self.glusterfs_target1])
@@ -596,6 +597,7 @@ class GlusterfsVolumeMappedLayoutTestCase(test.TestCase):
gmgr1.get_vol_option.assert_called_once_with(
'user.manila-cloned-from')
self._layout._wipe_gluster_vol.assert_called_once_with(gmgr1)
self.assertIn(new_vol_addr, self._layout.gluster_used_vols)
self._layout._push_gluster_vol.assert_called_once_with(
self.glusterfs_target1)
self._layout.private_storage.delete.assert_called_once_with(


+ 7
- 0
releasenotes/notes/bug-1894362-fix-Glusterfs-del-share-3c8467e1d9f0c6e4.yaml View File

@@ -0,0 +1,7 @@
---
fixes:
- |
Fixed `bug #1894362 <https://bugs.launchpad.net/manila/+bug/1894362>`_
Fixed the problem of Couldn't find the'gluster_used_vols' error when
deploying glusterfs driver multi-backend service and deleting share
instance.

Loading…
Cancel
Save