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
This commit is contained in:
Victoria Martinez de la Cruz 2022-09-30 09:36:47 +00:00
parent 3f431ef9eb
commit ed0af6e9dd
3 changed files with 17 additions and 8 deletions

View File

@ -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)
}

View File

@ -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": {

View File

@ -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.