diff --git a/manila/share/drivers/cephfs/cephfs_native.py b/manila/share/drivers/cephfs/cephfs_native.py index 5eb6f701..32c9b431 100644 --- a/manila/share/drivers/cephfs/cephfs_native.py +++ b/manila/share/drivers/cephfs/cephfs_native.py @@ -227,7 +227,8 @@ class CephFSNativeDriver(driver.ShareDriver,): self.volume_client.deauthorize(self._share_path(share), access['access_to']) - self.volume_client.evict(access['access_to']) + self.volume_client.evict(self._share_path(share), + access['access_to']) def update_access(self, context, share, access_rules, add_rules, delete_rules, share_server=None): @@ -287,11 +288,13 @@ class CephFSNativeDriver(driver.ShareDriver,): def create_snapshot(self, context, snapshot, share_server=None): self.volume_client.create_snapshot_volume( - self._share_path(snapshot['share']), snapshot['name']) + self._share_path(snapshot['share']), + '_'.join([snapshot['snapshot_id'], snapshot['id']])) def delete_snapshot(self, context, snapshot, share_server=None): self.volume_client.destroy_snapshot_volume( - self._share_path(snapshot['share']), snapshot['name']) + self._share_path(snapshot['share']), + '_'.join([snapshot['snapshot_id'], snapshot['id']])) def create_consistency_group(self, context, cg_dict, share_server=None): self.volume_client.create_group(cg_dict['id']) diff --git a/manila/tests/share/drivers/cephfs/test_cephfs_native.py b/manila/tests/share/drivers/cephfs/test_cephfs_native.py index 8630f766..d95dab3d 100644 --- a/manila/tests/share/drivers/cephfs/test_cephfs_native.py +++ b/manila/tests/share/drivers/cephfs/test_cephfs_native.py @@ -277,28 +277,30 @@ class CephFSNativeDriverTestCase(test.TestCase): def test_create_snapshot(self): self._driver.create_snapshot(self._context, { + "id": "instance1", "share": self._share, - "name": "snappy1" + "snapshot_id": "snappy1" }, None) (self._driver._volume_client.create_snapshot_volume .assert_called_once_with( self._driver._share_path(self._share), - "snappy1")) + "snappy1_instance1")) def test_delete_snapshot(self): self._driver.delete_snapshot(self._context, { + "id": "instance1", "share": self._share, - "name": "snappy1" + "snapshot_id": "snappy1" }, None) (self._driver._volume_client.destroy_snapshot_volume .assert_called_once_with( self._driver._share_path(self._share), - "snappy1")) + "snappy1_instance1")) def test_create_consistency_group(self): self._driver.create_consistency_group(self._context, {"id": "grp1"},