From: Patrick Seidensal Date: Mon, 12 Oct 2020 09:52:40 +0000 (+0200) Subject: mgr/dashboard: improve typing in Ceph services X-Git-Tag: v16.1.0~677^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=05b578940db3abbfa8109c6d7afbc17d0bdf70a2;p=ceph.git mgr/dashboard: improve typing in Ceph services Signed-off-by: Patrick Seidensal --- diff --git a/src/pybind/mgr/dashboard/services/ceph_service.py b/src/pybind/mgr/dashboard/services/ceph_service.py index 2661f9a4b53f..a045faee60fe 100644 --- a/src/pybind/mgr/dashboard/services/ceph_service.py +++ b/src/pybind/mgr/dashboard/services/ceph_service.py @@ -12,7 +12,7 @@ from .. import mgr from ..exceptions import DashboardException try: - from typing import Any, Dict, Union + from typing import Any, Dict, Union, Optional except ImportError: pass # For typing only @@ -158,8 +158,9 @@ class CephService(object): return {} return mgr.get("pg_summary")['by_pool'][pool['pool'].__str__()] - @classmethod - def send_command(cls, srv_type, prefix, srv_spec='', **kwargs): + @staticmethod + def send_command(srv_type, prefix, srv_spec='', **kwargs): + # type: (str, str, Optional[str], Any) -> Any """ :type prefix: str :param srv_type: mon | @@ -247,14 +248,14 @@ class CephService(object): @staticmethod def get_devices_by_host(hostname): - # (str) -> dict + # type: (str) -> dict return CephService.send_command('mon', 'device ls-by-host', host=hostname) @staticmethod def get_devices_by_daemon(daemon_type, daemon_id): - # (str, str) -> dict + # type: (str, str) -> dict return CephService.send_command('mon', 'device ls-by-daemon', who='{}.{}'.format(