]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Standby Dashboards don't handle all requests properly 32299/head
authorVolker Theile <vtheile@suse.com>
Thu, 19 Sep 2019 14:30:15 +0000 (16:30 +0200)
committerLaura Paduano <lpaduano@suse.com>
Thu, 16 Jan 2020 07:54:25 +0000 (08:54 +0100)
Fixes: https://tracker.ceph.com/issues/41930
Signed-off-by: Volker Theile <vtheile@suse.com>
(cherry picked from commit 29cc91f92d766e478251f301dc8e3e1e76f39c57)

qa/tasks/mgr/test_dashboard.py
src/pybind/mgr/dashboard/module.py

index b0cf200d61be46ef312e3ca9751759e7d9aac703..783c492d3f270eefa08412d60a8186d6a98d47f7 100644 (file)
@@ -49,11 +49,18 @@ class TestDashboard(MgrTestCase):
         self.assertNotEqual(original_uri, failed_over_uri)
 
         # The original active daemon should have come back up as a standby
-        # and be doing redirects to the new active daemon
+        # and be doing redirects to the new active daemon.
         r = requests.get(original_uri, allow_redirects=False, verify=False)
         self.assertEqual(r.status_code, 303)
         self.assertEqual(r.headers['Location'], failed_over_uri)
 
+        # Ensure that every URL redirects to the active daemon.
+        r = requests.get("{}/runtime.js".format(original_uri),
+                         allow_redirects=False,
+                         verify=False)
+        self.assertEqual(r.status_code, 303)
+        self.assertEqual(r.headers['Location'], failed_over_uri)
+
     def test_standby_disable_redirect(self):
         self.mgr_cluster.mon_manager.raw_cluster_cmd("config", "set", "mgr",
                                                      "mgr/dashboard/standby_behaviour",
index d38022beae328ba87572fb45ea6f0c8c8500ab76..f9f8659bf85fe6c182fb45ee4920d9ac64ae8b4d 100644 (file)
@@ -467,7 +467,7 @@ class StandbyModule(MgrStandbyModule, CherryPyConfig):
 
         class Root(object):
             @cherrypy.expose
-            def index(self):
+            def default(self, *args, **kwargs):
                 if module.get_module_option('standby_behaviour', 'redirect') == 'redirect':
                     active_uri = module.get_active_uri()
                     if active_uri: