]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix rbd mirroring daemon health status 50051/head
authorNizamudeen A <nia@redhat.com>
Thu, 9 Feb 2023 11:26:44 +0000 (16:56 +0530)
committerNizamudeen A <nia@redhat.com>
Thu, 9 Feb 2023 11:59:19 +0000 (17:29 +0530)
Fixes: https://tracker.ceph.com/issues/58679
Signed-off-by: Nizamudeen A <nia@redhat.com>
src/pybind/mgr/dashboard/controllers/rbd_mirroring.py
src/pybind/mgr/dashboard/tests/test_rbd_mirroring.py

index 738f2e8b2fce87e26a547ed27c1890727cc854f5..65eb0b56e8ba5bd55dcd696582625beb02e263bc 100644 (file)
@@ -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
             }
index 1d4dac3062bc17acfd34bc36230485725501535b..fd36f681b72d11c490e6873a98cf7668976f9381 100644 (file)
@@ -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})