]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mgr/dashboard: Handle errors for /api/osd/settings
authorAfreen <afreen23.git@gmail.com>
Tue, 13 Feb 2024 10:26:09 +0000 (15:56 +0530)
committerAfreen <afreen23.git@gmail.com>
Thu, 22 Feb 2024 09:01:35 +0000 (14:31 +0530)
commitaa9bd5ed19ad41d9fd084cea1d1f40468fe5c298
tree7e9f7eebd325d7090f49f0f75ab6048ab35098b7
parent0ed764e6499003b2b2b6ce9e2ae4edca7a7b16f5
mgr/dashboard: Handle errors for /api/osd/settings

Fixes https://tracker.ceph.com/issues/62089

issue:
=====
/api/osd/settings returns "TypeError: string indices must be
integers" sometimes.
The result is coming from `osd dump` command which instead of returning
an object returns an error message which then displays error on
dashboard.

fix:
====
Added a try-catch block to handle error and updated frontend code to
handle those

Signed-off-by: Afreen <afreen23.git@gmail.com>
(cherry picked from commit 518bff9c7ed6f6756aff8aa8013c48a5bfdd7b32)
src/pybind/mgr/dashboard/controllers/osd.py
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard-pie/dashboard-pie.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/usage-bar/usage-bar.component.html