]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Device health status is not getting listed under hosts section 43868/head
authorAashish Sharma <aashishsharma@localhost.localdomain>
Wed, 10 Nov 2021 08:27:47 +0000 (13:57 +0530)
committerAashish Sharma <aashishsharma@localhost.localdomain>
Wed, 10 Nov 2021 08:27:47 +0000 (13:57 +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>
src/pybind/mgr/dashboard/services/ceph_service.py
src/pybind/mgr/dashboard/tests/test_ceph_service.py

index 2705f7f993ab5e4165b27303e33377cd4ddc93af..c1e0db2daa01f8a376bbc4aab6d3fe4d3c42822d 100644 (file)
@@ -265,13 +265,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 f3350337c74c5345c8a12a39bec53818c7564b7a..2ad9576af80056c755be7ce187db46e5a1929340 100644 (file)
@@ -125,4 +125,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')])