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

This commit is contained in:
Zuul 2020-09-16 07:19:34 +00:00 committed by Gerrit Code Review
commit 5f433b59ba
3 changed files with 13 additions and 0 deletions

View File

@ -435,6 +435,10 @@ class GlusterfsVolumeMappedLayout(layout.GlusterfsShareLayoutBase):
gmgr.set_vol_option(USER_MANILA_SHARE, 'NONE') gmgr.set_vol_option(USER_MANILA_SHARE, 'NONE')
gmgr.set_vol_option('nfs.disable', 'on') 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) self._push_gluster_vol(gmgr.qualified)
except exception.GlusterfsException: except exception.GlusterfsException:
msg = ("Error during delete_share request for " msg = ("Error during delete_share request for "

View File

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

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.