]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/dashboard: upgrading nvmeof doesn't update configuration 62457/head
authorNizamudeen A <nia@redhat.com>
Mon, 24 Mar 2025 11:39:04 +0000 (17:09 +0530)
committerNizamudeen A <nia@redhat.com>
Mon, 24 Mar 2025 16:57:05 +0000 (22:27 +0530)
commit6e9ac798e354aa37b41708aae099095baec0061d
treebbbfb0a7f8f5d72ae456680c450414504765809c
parent6fc1a6dd926a52773b98894e1092aea0d63d16ad
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>
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