]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mgr/dashboard: Handle errors for /api/osd/settings 55704/head
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:02:46 +0000 (14:32 +0530)
commit5c3b2d74aeb3a4bd58e151b08fc76f6cf70bba9c
tree3251d7908af1a6c0ab7cbfd66dea7ac2ac1f6734
parent716316e0c5f01cce3131320d3066aabd8ddb666a
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