]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix dashboard instance ssl certificate functionality 40003/head
authorAvan Thakkar <athakkar@redhat.com>
Tue, 16 Feb 2021 22:25:29 +0000 (03:55 +0530)
committerAvan Thakkar <athakkar@localhost.localdomain>
Thu, 11 Mar 2021 07:52:45 +0000 (13:22 +0530)
Fixes: https://tracker.ceph.com/issues/46542
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
(cherry picked from commit 0a88c62e76f80a4ad9c01a91161b77ac6f073ed4)

 Conflicts:
src/pybind/mgr/dashboard/module.py
src/pybind/mgr/mgr_module.py
  - Adopting required master branch changes.

src/pybind/mgr/dashboard/module.py
src/pybind/mgr/mgr_module.py

index 9770bd85652f5ac80266b3bd776bca83b0a2a1e1..224b05cab2248b986ada46b95f811576a2226eaa 100644 (file)
@@ -152,7 +152,7 @@ class CherryPyConfig(object):
 
         if use_ssl:
             # SSL initialization
-            cert = self.get_store("crt")
+            cert = self.get_localized_store("crt")
             if cert is not None:
                 self.cert_tmp = tempfile.NamedTemporaryFile()
                 self.cert_tmp.write(cert.encode('utf-8'))
@@ -161,7 +161,7 @@ class CherryPyConfig(object):
             else:
                 cert_fname = self.get_localized_module_option('crt_file')
 
-            pkey = self.get_store("key")
+            pkey = self.get_localized_store("key")
             if pkey is not None:
                 self.pkey_tmp = tempfile.NamedTemporaryFile()
                 self.pkey_tmp.write(pkey.encode('utf-8'))
index 79cbc95036e32f129a5f233245a4af48d12845a1..07d590fafa22e7fae7646c71f95fba822408d749 100644 (file)
@@ -556,6 +556,14 @@ class MgrStandbyModule(ceph_module.BaseMgrStandbyModule):
         """
         return self._ceph_get_store(key)
 
+    def get_localized_store(self, key, default=None):
+        r = self._ceph_get_store(_get_localized_key(self.get_mgr_id(), key))
+        if r is None:
+            r = self._ceph_get_store(key)
+            if r is None:
+                r = default
+        return r
+
     def get_active_uri(self):
         return self._ceph_get_active_uri()