From 05dcc06dde308f979bb1c9236e33448ab4959216 Mon Sep 17 00:00:00 2001 From: Ramana Raja Date: Tue, 12 Apr 2016 21:47:12 +0530 Subject: [PATCH] cephfs_native: Fix client eviction During deny access, the driver evicts client based on its auth ID and the share its accessing. It does not make the correct use of ceph_volume_client library to do this. So fix the evict method call. Closes-Bug: #1567298 Change-Id: I707d1f2d455106f45c35aa28ca2a30fb0460f9e8 --- manila/share/drivers/cephfs/cephfs_native.py | 5 +++-- manila/tests/share/drivers/cephfs/test_cephfs_native.py | 3 +++ .../notes/cephfs-native-fix-evict-c45fd2de8f520757.yaml | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/cephfs-native-fix-evict-c45fd2de8f520757.yaml diff --git a/manila/share/drivers/cephfs/cephfs_native.py b/manila/share/drivers/cephfs/cephfs_native.py index 32c9b4319d..7d0bbddba7 100644 --- a/manila/share/drivers/cephfs/cephfs_native.py +++ b/manila/share/drivers/cephfs/cephfs_native.py @@ -227,8 +227,9 @@ class CephFSNativeDriver(driver.ShareDriver,): self.volume_client.deauthorize(self._share_path(share), access['access_to']) - self.volume_client.evict(self._share_path(share), - access['access_to']) + self.volume_client.evict( + access['access_to'], + volume_path=self._share_path(share)) def update_access(self, context, share, access_rules, add_rules, delete_rules, share_server=None): diff --git a/manila/tests/share/drivers/cephfs/test_cephfs_native.py b/manila/tests/share/drivers/cephfs/test_cephfs_native.py index aa1ef9f261..2b92a40a12 100644 --- a/manila/tests/share/drivers/cephfs/test_cephfs_native.py +++ b/manila/tests/share/drivers/cephfs/test_cephfs_native.py @@ -200,6 +200,9 @@ class CephFSNativeDriverTestCase(test.TestCase): self._driver._volume_client.deauthorize.assert_called_once_with( self._driver._share_path(self._share), "alice") + self._driver._volume_client.evict.assert_called_once_with( + "alice", + volume_path=self._driver._share_path(self._share)) def test_update_access_add_rm(self): alice = { diff --git a/releasenotes/notes/cephfs-native-fix-evict-c45fd2de8f520757.yaml b/releasenotes/notes/cephfs-native-fix-evict-c45fd2de8f520757.yaml new file mode 100644 index 0000000000..8bb3f826a4 --- /dev/null +++ b/releasenotes/notes/cephfs-native-fix-evict-c45fd2de8f520757.yaml @@ -0,0 +1,3 @@ +--- +fixes: + - In cephfs_native driver, fixed client eviction call during access denial.