]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mgr/dashboard: upgrading nvmeof doesn't update configuration
authorNizamudeen A <nia@redhat.com>
Mon, 24 Mar 2025 11:39:04 +0000 (17:09 +0530)
committerNizamudeen A <nia@redhat.com>
Thu, 12 Jun 2025 09:40:31 +0000 (15:10 +0530)
commit6c15209e9a477652be66ab89fa14b4b8d9ec8c66
tree28fd27bbc02fbc361d0b5e243ff92c5d6eab1bf8
parentf787578ef2f71869b8f1cc1e55b46dafcf77a71f
mgr/dashboard: upgrading nvmeof doesn't update configuration

Happens from 19.2.0 to any of the latest upgrade

During upgrade I get
```
Failed to set Dashboard config for nvmeof: dashboard nvmeof-gateway-add failed: JSON array/object not allowed {"prefix": "dashboard nvmeof-gateway-add", "name": "nvmeof.rbd", "group": null, "daemon_name": "nvmeof.rbd.ceph-node-01.irpssg"} retval: -22
```

which is fixed by handling the group_name when its not there in spec.

And the other error was
```
Failed to set Dashboard config for nvmeof: dashboard nvmeof-gateway-add failed: Traceback (most recent call last): File "/usr/share/ceph/mgr/mgr_module.py", line 1864, in _handle_command return CLICommand.COMMANDS[cmd['prefix']].call(self, cmd, inbuf) File "/usr/share/ceph/mgr/mgr_module.py", line 499, in call return self.func(mgr, **kwargs) File "/usr/share/ceph/mgr/mgr_module.py", line 535, in check return func(*args, **kwargs) File "/usr/share/ceph/mgr/dashboard/services/nvmeof_cli.py", line 28, in add_nvmeof_gateway NvmeofGatewaysConfig.add_gateway(name, service_url, group, daemon_name) File "/usr/share/ceph/mgr/dashboard/services/nvmeof_conf.py", line 61, in add_gateway gateway['daemon_name'] = daemon_name TypeError: 'str' object does not support item assignment retval: -22
```

which is fixed by properly updating the config to the newer format that
is available in newer version

Fixes: https://tracker.ceph.com/issues/70629
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit 6e9ac798e354aa37b41708aae099095baec0061d)

 Conflicts:
src/pybind/mgr/dashboard/tests/test_nvmeof_cli.py
 -  kept test file and only added the relavant test files
src/pybind/mgr/cephadm/services/nvmeof.py
src/pybind/mgr/dashboard/services/nvmeof_conf.py
src/pybind/mgr/dashboard/tests/__init__.py
src/pybind/mgr/dashboard/tests/test_nvmeof_cli.py [new file with mode: 0644]