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