From 05b578940db3abbfa8109c6d7afbc17d0bdf70a2 Mon Sep 17 00:00:00 2001 From: Patrick Seidensal Date: Mon, 12 Oct 2020 11:52:40 +0200 Subject: [PATCH] mgr/dashboard: improve typing in Ceph services Signed-off-by: Patrick Seidensal --- src/pybind/mgr/dashboard/services/ceph_service.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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( -- 2.47.3