]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Device health status is not getting listed under hosts section 44053/head
authorAashish Sharma <aashishsharma@localhost.localdomain>
Wed, 10 Nov 2021 08:27:47 +0000 (13:57 +0530)
committerAvan Thakkar <athakkar@redhat.com>
Mon, 22 Nov 2021 20:55:44 +0000 (02:25 +0530)
Device health is shown as failed to retrieve data under Hosts > Device Health section. This PR intends to fix this issue.

Fixes: https://tracker.ceph.com/issues/53209
Signed-off-by: Aashish Sharma <aasharma@redhat.com>
(cherry picked from commit 8b868d20c470289c2f23049ac5dbbd2ba0307385)

src/pybind/mgr/dashboard/services/ceph_service.py
src/pybind/mgr/dashboard/tests/test_ceph_service.py

index a4d0fbca9c74b0b80ff7b0f165b7aae8a0f083ac..3492b96549806baa9de025f5ddc8dde336916a99 100644 (file)
@@ -266,13 +266,15 @@ class CephService(object):
                     except SendCommandError:
                         # Try to retrieve SMART data from another daemon.
                         continue
-                else:
+                elif 'mon' in svc_type:
                     try:
                         dev_smart_data = CephService.send_command(
-                            svc_type, 'device get-health-metrics', svc_id, devid=device['devid'])
+                            svc_type, 'device query-daemon-health-metrics', who=daemon)
                     except SendCommandError:
                         # Try to retrieve SMART data from another daemon.
                         continue
+                else:
+                    dev_smart_data = {}
                 for dev_id, dev_data in dev_smart_data.items():
                     if 'error' in dev_data:
                         logger.warning(
index 9a8ca674c23634639192b8ab5e46a00d9eb3c172..40f6eb9efa464d4c0888479899505de3fcc04394 100644 (file)
@@ -126,4 +126,7 @@ def test_get_smart_data_from_appropriate_ceph_command(send_command):
     ]
     CephService._get_smart_data_by_device({'devid': '1', 'daemons': ['osd.1', 'mon.1']})
     send_command.assert_has_calls([mock.call('mon', 'osd tree'),
-                                   mock.call('mon', 'device get-health-metrics', '1', devid='1')])
+                                   mock.call('osd', 'smart', '1', devid='1'),
+                                   mock.call('mon', 'osd tree'),
+                                   mock.call('mon', 'device query-daemon-health-metrics',
+                                             who='mon.1')])