Browse Source

CephFS driver: change CG variables to SG variables

in the native cephfs driver to align with the overall deprecation
in manila of Consistency Groups in favor of Share Groups.

Also update a docstring reference to Consistency groups in the
base driver class.

TrivialFix

Change-Id: I69d7d390ae4d4cc7419e4e20c81f44349c533dc8
changes/25/443325/2
Tom Barron 5 years ago
parent
commit
35a0059462
  1. 2
      manila/share/driver.py
  2. 8
      manila/share/drivers/cephfs/cephfs_native.py
  3. 8
      manila/tests/share/drivers/cephfs/test_cephfs_native.py

2
manila/share/driver.py

@ -865,7 +865,7 @@ class ShareDriver(object):
:param share_servers: list with share-server models
:param share: share model
:param snapshot: snapshot model
:param share_group: ConsistencyGroup model with shares
:param share_group: ShareGroup model with shares
:returns: share-server or None
"""
# If creating in a share group, use its share server

8
manila/share/drivers/cephfs/cephfs_native.py

@ -341,11 +341,11 @@ class CephFSNativeDriver(driver.ShareDriver,):
self._share_path(snapshot['share']),
'_'.join([snapshot['snapshot_id'], snapshot['id']]))
def create_share_group(self, context, cg_dict, share_server=None):
self.volume_client.create_group(cg_dict['id'])
def create_share_group(self, context, sg_dict, share_server=None):
self.volume_client.create_group(sg_dict['id'])
def delete_share_group(self, context, cg_dict, share_server=None):
self.volume_client.destroy_group(cg_dict['id'])
def delete_share_group(self, context, sg_dict, share_server=None):
self.volume_client.destroy_group(sg_dict['id'])
def delete_share_group_snapshot(self, context, snap_dict,
share_server=None):

8
manila/tests/share/drivers/cephfs/test_cephfs_native.py

@ -394,21 +394,21 @@ class CephFSNativeDriverTestCase(test.TestCase):
def test_create_share_snapshot(self):
self._driver.create_share_group_snapshot(self._context, {
'share_group_id': 'cgid',
'share_group_id': 'sgid',
'id': 'snapid'
})
(self._driver._volume_client.create_snapshot_group.
assert_called_once_with("cgid", "snapid"))
assert_called_once_with("sgid", "snapid"))
def test_delete_share_group_snapshot(self):
self._driver.delete_share_group_snapshot(self._context, {
'share_group_id': 'cgid',
'share_group_id': 'sgid',
'id': 'snapid'
})
(self._driver._volume_client.destroy_snapshot_group.
assert_called_once_with("cgid", "snapid"))
assert_called_once_with("sgid", "snapid"))
def test_delete_driver(self):
# Create share to prompt volume_client construction

Loading…
Cancel
Save