]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mgr/dashboard: adapt nfs export code to the new changes in nfs module
authorNizamudeen A <nia@redhat.com>
Thu, 9 Feb 2023 15:59:41 +0000 (21:29 +0530)
committerNizamudeen A <nia@redhat.com>
Tue, 14 Feb 2023 11:11:09 +0000 (16:41 +0530)
commitdbcf28d462a8a3dc2b8709d1fc7af8df08c6694d
tree0d03eb8ea7ff518bc323d20e4f7e9c09e1738a64
parentc65085ed889f49ad4e956fd5e2f2dd15a8766864
mgr/dashboard: adapt nfs export code to the new changes in nfs module

when you create/edit an nfs export from dashboard it leaves this traceback and error

```
Feb 09 14:15:54 ceph-node-00 ceph-mgr[3235]: [dashboard ERROR taskexec] Error while calling Task(ns=nfs/create, md={'path': 'e2e.nfs.bucket', 'fsal': 'RGW', 'cluster_id': 'testnfs'})
                                             Traceback (most recent call last):
                                               File "/usr/share/ceph/mgr/dashboard/tools.py", line 550, in _run
                                                 val = self.task.fn(*self.task.fn_args, **self.task.fn_kwargs)  # type: ignore
                                               File "/usr/share/ceph/mgr/dashboard/controllers/nfs.py", line 148, in create
                                                 ret, _, err = export_mgr.apply_export(cluster_id, json.dumps(raw_ex))
                                             TypeError: 'AppliedExportResults' object is not iterable
Feb 09 14:15:54 ceph-node-00 ceph-mgr[3235]: [dashboard INFO taskmgr] finished Task(ns=nfs/create, md={'path': 'e2e.nfs.bucket', 'fsal': 'RGW', 'cluster_id': 'testnfs'})
Feb 09 14:15:54 ceph-node-00 ceph-mgr[3235]: [dashboard INFO request] [::ffff:192.168.100.1:43896] [POST] [500] [0.767s] [admin] [172.0B] /api/nfs-ganesha/export
```
This started after https://github.com/ceph/ceph/pull/46209, so dashboard code needs to be adapted

Fixes: https://tracker.ceph.com/issues/58681
Signed-off-by: Nizamudeen A <nia@redhat.com>
src/pybind/mgr/dashboard/controllers/nfs.py
src/pybind/mgr/dashboard/tests/test_nfs.py
src/pybind/mgr/nfs/export.py