From ed0af6e9dd5346c5e86ea0582d7d00817c60aea3 Mon Sep 17 00:00:00 2001 From: Victoria Martinez de la Cruz Date: Fri, 30 Sep 2022 09:36:47 +0000 Subject: [PATCH] Rename 'nfs_cluster_id' to 'cluster_id' in the NFSProtocolHelper The CephFS NFS driver, specifically the NFSProtocolHelper implementation, is passing a wrong param to the Ceph backend and this is preventing users to add and/or deny access to the created shares. The 'nfs_cluster_id' field has been renamed to 'cluster_id' to comply with what the rados client expects. With this fix, users of the CephFS NFS NFSProtocolHelper can normally create and remove access to their shares. Closes-Bug: #1991378 Change-Id: Ibc5681e59691d55536c5539feef97b14f74d98ba --- manila/share/drivers/cephfs/driver.py | 8 ++++---- manila/tests/share/drivers/cephfs/test_driver.py | 8 ++++---- ...fix-cluster_id-param-cephfs-nfs-2ddc4ff98141b9b9.yaml | 9 +++++++++ 3 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 releasenotes/notes/bug-1991378-fix-cluster_id-param-cephfs-nfs-2ddc4ff98141b9b9.yaml diff --git a/manila/share/drivers/cephfs/driver.py b/manila/share/drivers/cephfs/driver.py index 620b3703e6..54fa85b079 100644 --- a/manila/share/drivers/cephfs/driver.py +++ b/manila/share/drivers/cephfs/driver.py @@ -1177,7 +1177,7 @@ class NFSClusterProtocolHelper(NFSProtocolHelperMixin, ganesha.NASHelperBase): export_ips = [] argdict = { - "nfs_cluster_id": nfs_clusterid, + "cluster_id": nfs_clusterid, } output = rados_command(self.rados_client, "nfs cluster info", argdict) @@ -1206,7 +1206,7 @@ class NFSClusterProtocolHelper(NFSProtocolHelperMixin, ganesha.NASHelperBase): """Allow access to the share.""" export = { "path": self._get_export_path(share), - "nfs_cluster_id": self.nfs_clusterid, + "cluster_id": self.nfs_clusterid, "pseudo": self._get_export_pseudo_path(share), "squash": "none", "security_label": True, @@ -1220,7 +1220,7 @@ class NFSClusterProtocolHelper(NFSProtocolHelperMixin, ganesha.NASHelperBase): } argdict = { - "nfs_cluster_id": self.nfs_clusterid, + "cluster_id": self.nfs_clusterid, } inbuf = json.dumps(export).encode('utf-8') @@ -1231,7 +1231,7 @@ class NFSClusterProtocolHelper(NFSProtocolHelperMixin, ganesha.NASHelperBase): """Deny access to the share.""" argdict = { - "nfs_cluster_id": self.nfs_clusterid, + "cluster_id": self.nfs_clusterid, "pseudo_path": self._get_export_pseudo_path(share) } diff --git a/manila/tests/share/drivers/cephfs/test_driver.py b/manila/tests/share/drivers/cephfs/test_driver.py index c53b113f25..dee29f6385 100644 --- a/manila/tests/share/drivers/cephfs/test_driver.py +++ b/manila/tests/share/drivers/cephfs/test_driver.py @@ -1278,12 +1278,12 @@ class NFSClusterProtocolHelperTestCase(test.TestCase): } access_allow_dict = { - "nfs_cluster_id": nfs_clusterid, + "cluster_id": nfs_clusterid, } export = { "path": "ganesha:/foo/bar", - "nfs_cluster_id": nfs_clusterid, + "cluster_id": nfs_clusterid, "pseudo": "ganesha:/foo/bar", "squash": "none", "security_label": True, @@ -1310,7 +1310,7 @@ class NFSClusterProtocolHelperTestCase(test.TestCase): nfs_clusterid = self._nfscluster_protocol_helper.nfs_clusterid access_deny_dict = { - "nfs_cluster_id": nfs_clusterid, + "cluster_id": nfs_clusterid, "pseudo_path": "ganesha:/foo/bar" } @@ -1325,7 +1325,7 @@ class NFSClusterProtocolHelperTestCase(test.TestCase): nfs_clusterid = self._nfscluster_protocol_helper.nfs_clusterid cluster_info_dict = { - "nfs_cluster_id": nfs_clusterid, + "cluster_id": nfs_clusterid, } cluster_info = {"fs-manila": { diff --git a/releasenotes/notes/bug-1991378-fix-cluster_id-param-cephfs-nfs-2ddc4ff98141b9b9.yaml b/releasenotes/notes/bug-1991378-fix-cluster_id-param-cephfs-nfs-2ddc4ff98141b9b9.yaml new file mode 100644 index 0000000000..e8a7b3c740 --- /dev/null +++ b/releasenotes/notes/bug-1991378-fix-cluster_id-param-cephfs-nfs-2ddc4ff98141b9b9.yaml @@ -0,0 +1,9 @@ +--- +fixes: + - | + The CephFS NFS driver, specifically the NFSProtocolHelper + implementation, was passing a wrong param to the Ceph backend + and this was preventing users to add and deny access to the + created shares. With this fix, users of the CephFS NFS + NFSProtocolHelper can normally create and remove access + to their shares.