From 25bc57d38f7b5350280112a34b34fdc37ce2be29 Mon Sep 17 00:00:00 2001 From: Nizamudeen A Date: Thu, 9 Feb 2023 16:56:44 +0530 Subject: [PATCH] mgr/dashboard: fix rbd mirroring daemon health status Fixes: https://tracker.ceph.com/issues/58679 Signed-off-by: Nizamudeen A --- src/pybind/mgr/dashboard/controllers/rbd_mirroring.py | 4 ++-- src/pybind/mgr/dashboard/tests/test_rbd_mirroring.py | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/pybind/mgr/dashboard/controllers/rbd_mirroring.py b/src/pybind/mgr/dashboard/controllers/rbd_mirroring.py index 738f2e8b2fce8..65eb0b56e8ba5 100644 --- a/src/pybind/mgr/dashboard/controllers/rbd_mirroring.py +++ b/src/pybind/mgr/dashboard/controllers/rbd_mirroring.py @@ -94,7 +94,7 @@ def get_daemons(): def get_daemon_health(daemon): health = { - 'health': MirrorHealth.MIRROR_HEALTH_UNKNOWN + 'health': MirrorHealth.MIRROR_HEALTH_DISABLED } for _, pool_data in daemon['status'].items(): if (health['health'] != MirrorHealth.MIRROR_HEALTH_ERROR @@ -109,7 +109,7 @@ def get_daemon_health(daemon): health = { 'health': MirrorHealth.MIRROR_HEALTH_WARNING } - elif health['health'] == MirrorHealth.MIRROR_HEALTH_INFO: + elif health['health'] == MirrorHealth.MIRROR_HEALTH_DISABLED: health = { 'health': MirrorHealth.MIRROR_HEALTH_OK } diff --git a/src/pybind/mgr/dashboard/tests/test_rbd_mirroring.py b/src/pybind/mgr/dashboard/tests/test_rbd_mirroring.py index 1d4dac3062bc1..fd36f681b72d1 100644 --- a/src/pybind/mgr/dashboard/tests/test_rbd_mirroring.py +++ b/src/pybind/mgr/dashboard/tests/test_rbd_mirroring.py @@ -31,7 +31,11 @@ mock_get_metadata = { _status = { 1: { - 'callouts': {}, + 'callouts': { + 'image': { + 'level': 'warning', + } + }, 'image_local_count': 5, 'image_remote_count': 6, 'image_error_count': 7, @@ -288,6 +292,7 @@ class RbdMirroringSummaryControllerTest(ControllerTestCase): self.assertStatus(200) summary = self.json_body()['rbd_mirroring'] + # 2 warnings: 1 for the daemon, 1 for the pool self.assertEqual(summary, {'errors': 0, 'warnings': 2}) -- 2.39.5