summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/module.py
diff options
context:
space:
mode:
authorKefu Chai <kchai@redhat.com>2021-01-19 18:56:02 +0100
committerKefu Chai <kchai@redhat.com>2021-01-26 11:02:24 +0100
commit34e96c55397da7029254864ebf7a3d88563e22c9 (patch)
tree838593a41fc18a135bd38a40be5e6564405eb10f /src/pybind/mgr/dashboard/module.py
parentpybind/mgr/prometheus: add assert to appease mypy (diff)
downloadceph-34e96c55397da7029254864ebf7a3d88563e22c9.tar.xz
ceph-34e96c55397da7029254864ebf7a3d88563e22c9.zip
pybind/mgr/dashboard: use _get_localized_key for composing store key
Just for keeping this 'encapsulated', there's _get_localized_key helper in mgr_module (there's also a set_localized_store but it only deals with the active manager) As suggested by Ernesto Puerta <epuertat@redhat.com> Signed-off-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'src/pybind/mgr/dashboard/module.py')
-rw-r--r--src/pybind/mgr/dashboard/module.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pybind/mgr/dashboard/module.py b/src/pybind/mgr/dashboard/module.py
index 6c6fe9295b0..c389ce9581d 100644
--- a/src/pybind/mgr/dashboard/module.py
+++ b/src/pybind/mgr/dashboard/module.py
@@ -16,7 +16,7 @@ import threading
import time
from typing import Optional
-from mgr_module import CLIWriteCommand, MgrModule, MgrStandbyModule, Option
+from mgr_module import CLIWriteCommand, MgrModule, MgrStandbyModule, Option, _get_localized_key
from mgr_util import ServerConfigException, create_self_signed_cert, \
get_default_addr, verify_tls_files
@@ -367,7 +367,7 @@ 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.decode())
+ self.set_store(_get_localized_key(mgr_id, 'crt'), inbuf.decode())
else:
self.set_store('crt', inbuf.decode())
return 0, 'SSL certificate updated', ''
@@ -380,7 +380,7 @@ 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.decode())
+ self.set_store(_get_localized_key(mgr_id, 'key'), inbuf.decode())
else:
self.set_store('key', inbuf.decode())
return 0, 'SSL certificate key updated', ''