]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #32953 from votdev/issue_43665_smart_data
authorLenz Grimmer <lgrimmer@suse.com>
Thu, 27 Feb 2020 08:23:17 +0000 (08:23 +0000)
committerGitHub <noreply@github.com>
Thu, 27 Feb 2020 08:23:17 +0000 (08:23 +0000)
mgr/dashboard: smart: smart data read out on down osd causes error popup

Reviewed-by: Laura Paduano <lpaduano@suse.com>
Reviewed-by: Patrick Seidensal <pnawracay@suse.com>
Reviewed-by: Stephan Müller <smueller@suse.com>
1  2 
src/pybind/mgr/dashboard/services/ceph_service.py

index 6c83dcc75570f8492e2b48195f5dbefe47fb6415,f9d2738ff0d76c8fa4597e2742f85b6b417b5394..f015c92f1ca5ef78a1cf2cf94007f5a1c438186d
@@@ -9,9 -9,10 +9,10 @@@ from mgr_module import CommandResul
  from mgr_util import get_time_series_rates, get_most_recent_rate
  
  from .. import mgr
+ from ..exceptions import DashboardException
  
  try:
 -    from typing import Dict, Any  # pylint: disable=unused-import
 +    from typing import Dict  # pylint: disable=unused-import
  except ImportError:
      pass  # For typing only
  
@@@ -191,8 -230,16 +230,16 @@@ class CephService(object)
      @staticmethod
      def get_smart_data_by_host(hostname):
          # type: (str) -> dict
+         """
+         Get the SMART data of all devices on the given host, regardless
+         of the daemon (osd, mon, ...).
+         :param hostname: The name of the host.
+         :return: A dictionary containing the SMART data of every device
+           on the given host. The device name is used as the key in the
+           dictionary.
+         """
          devices = CephService.get_devices_by_host(hostname)
 -        smart_data = {}
 +        smart_data = {}  # type: dict
          if devices:
              for device in devices:
                  if device['devid'] not in smart_data: