From 5c0c122597161d4c3d4b421685b708afd6134427 Mon Sep 17 00:00:00 2001 From: Patrick Nawracay Date: Tue, 16 Oct 2018 16:28:24 +0200 Subject: [PATCH] mgr/dashboard: Fix Python3 issue Which results in a 500 error when trying to access the `Performance Counter` tab on the OSD list. Signed-off-by: Patrick Nawracay --- qa/tasks/mgr/dashboard/test_perf_counters.py | 2 +- src/pybind/mgr/dashboard/controllers/perf_counters.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qa/tasks/mgr/dashboard/test_perf_counters.py b/qa/tasks/mgr/dashboard/test_perf_counters.py index cd016434646ab..33e10e08e8116 100644 --- a/qa/tasks/mgr/dashboard/test_perf_counters.py +++ b/qa/tasks/mgr/dashboard/test_perf_counters.py @@ -69,5 +69,5 @@ class PerfCountersControllerTest(DashboardTestCase): 'detail': str, 'traceback': str, }) - self.assertEqual(self._resp.json()['detail'], 'osd.{} not found'.format(unused_id)) + self.assertEqual(self._resp.json()['detail'], "'osd.{}' not found".format(unused_id)) self.assertSchemaBody(schema) diff --git a/src/pybind/mgr/dashboard/controllers/perf_counters.py b/src/pybind/mgr/dashboard/controllers/perf_counters.py index 130dc1024ad1f..bfe495619ccfa 100644 --- a/src/pybind/mgr/dashboard/controllers/perf_counters.py +++ b/src/pybind/mgr/dashboard/controllers/perf_counters.py @@ -17,7 +17,7 @@ class PerfCounter(RESTController): try: schema = schema_dict["{}.{}".format(self.service_type, service_id)] except KeyError as e: - raise cherrypy.HTTPError(404, "{0} not found".format(e.message)) + raise cherrypy.HTTPError(404, "{0} not found".format(e)) counters = [] for key, value in sorted(schema.items()): -- 2.39.5