From: Kefu Chai Date: Sun, 17 Jan 2021 08:09:36 +0000 (+0800) Subject: mgr/dashboard: pass str as the 2nd param of set_store() X-Git-Tag: v16.2.0~230^2~29 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ad1c9d26dbf92cdf85ebf00567d822ac519d9fb1;p=ceph.git mgr/dashboard: pass str as the 2nd param of set_store() MgrModule.set_store() only accepts str or None as its second parameter. Signed-off-by: Kefu Chai (cherry picked from commit 2d20390b17649beae72a0be1eb6da286ed9788ae) --- diff --git a/src/pybind/mgr/dashboard/module.py b/src/pybind/mgr/dashboard/module.py index 087eda573804..6c6fe9295b0b 100644 --- a/src/pybind/mgr/dashboard/module.py +++ b/src/pybind/mgr/dashboard/module.py @@ -367,9 +367,9 @@ class Module(MgrModule, CherryPyConfig): return -errno.EINVAL, '',\ 'Please specify the certificate file with "-i" option' if mgr_id is not None: - self.set_store('{}/crt'.format(mgr_id), inbuf) + self.set_store('{}/crt'.format(mgr_id), inbuf.decode()) else: - self.set_store('crt', inbuf) + self.set_store('crt', inbuf.decode()) return 0, 'SSL certificate updated', '' @CLIWriteCommand("dashboard set-ssl-certificate-key") @@ -380,9 +380,9 @@ class Module(MgrModule, CherryPyConfig): return -errno.EINVAL, '',\ 'Please specify the certificate key file with "-i" option' if mgr_id is not None: - self.set_store('{}/key'.format(mgr_id), inbuf) + self.set_store('{}/key'.format(mgr_id), inbuf.decode()) else: - self.set_store('key', inbuf) + self.set_store('key', inbuf.decode()) return 0, 'SSL certificate key updated', '' def handle_command(self, inbuf, cmd):