From: Volker Theile Date: Thu, 19 Sep 2019 14:30:15 +0000 (+0200) Subject: mgr/dashboard: Standby Dashboards don't handle all requests properly X-Git-Tag: v14.2.8~20^2~9^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cca4b4b4d6d08dfaa1a2914e5336701f43fe3f6f;p=ceph.git mgr/dashboard: Standby Dashboards don't handle all requests properly Fixes: https://tracker.ceph.com/issues/41930 Signed-off-by: Volker Theile (cherry picked from commit 29cc91f92d766e478251f301dc8e3e1e76f39c57) --- diff --git a/qa/tasks/mgr/test_dashboard.py b/qa/tasks/mgr/test_dashboard.py index b0cf200d61b..783c492d3f2 100644 --- a/qa/tasks/mgr/test_dashboard.py +++ b/qa/tasks/mgr/test_dashboard.py @@ -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", diff --git a/src/pybind/mgr/dashboard/module.py b/src/pybind/mgr/dashboard/module.py index d38022beae3..f9f8659bf85 100644 --- a/src/pybind/mgr/dashboard/module.py +++ b/src/pybind/mgr/dashboard/module.py @@ -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: