From: Jason Dillaman Date: Wed, 27 Nov 2019 17:03:21 +0000 (-0500) Subject: mgr/dashboard: properly handle a missing rbd-mirror service status X-Git-Tag: v14.2.8~20^2~70^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F32133%2Fhead;p=ceph.git mgr/dashboard: properly handle a missing rbd-mirror service status This was resulting in 500 errors in the dashboard due to the missing status being handled like a dict. Fixes: https://tracker.ceph.com/issues/43029 Signed-off-by: Jason Dillaman (cherry picked from commit 499d749e3f96ef9af0fa2381a47efc2a745eff45) --- diff --git a/src/pybind/mgr/dashboard/controllers/rbd_mirroring.py b/src/pybind/mgr/dashboard/controllers/rbd_mirroring.py index cb4f1cea7721..0f6574a4667c 100644 --- a/src/pybind/mgr/dashboard/controllers/rbd_mirroring.py +++ b/src/pybind/mgr/dashboard/controllers/rbd_mirroring.py @@ -50,7 +50,7 @@ def get_daemons_and_pools(): # pylint: disable=R0915 for service in server['services']: id = service['id'] # pylint: disable=W0622 metadata = service['metadata'] - status = service['status'] + status = service['status'] or {} try: status = json.loads(status['json'])