Skip to content

Commit

Permalink
mgr/dashboard: improve typing in Ceph services
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Seidensal <[email protected]>
  • Loading branch information
p-se committed Oct 13, 2020
1 parent 8ae611e commit 05b5789
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/pybind/mgr/dashboard/services/ceph_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from ..exceptions import DashboardException

try:
from typing import Any, Dict, Union
from typing import Any, Dict, Union, Optional
except ImportError:
pass # For typing only

Expand Down Expand Up @@ -158,8 +158,9 @@ def get_pool_pg_status(cls, pool_name):
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 |
Expand Down Expand Up @@ -247,14 +248,14 @@ def _get_smart_data_by_device(device):

@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(
Expand Down

0 comments on commit 05b5789

Please sign in to comment.