From: Patrick Nawracay Date: Tue, 16 Oct 2018 14:28:24 +0000 (+0200) Subject: mgr/dashboard: Fix Python3 issue X-Git-Tag: v14.1.0~1167^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5c0c122597161d4c3d4b421685b708afd6134427;p=ceph.git 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 --- diff --git a/qa/tasks/mgr/dashboard/test_perf_counters.py b/qa/tasks/mgr/dashboard/test_perf_counters.py index cd016434646..33e10e08e81 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 130dc1024ad..bfe495619cc 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()):