mirror of
https://github.com/ceph/ceph
synced 2025-02-20 17:37:29 +00:00
pybind/mgr/cephadm/serve: add assert to appease mypy
Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
parent
2fd0a03192
commit
2a5a50f3ba
@ -401,13 +401,17 @@ class CephadmServe:
|
||||
daemon_detail = [] # type: List[str]
|
||||
for item in ls:
|
||||
host = item.get('hostname')
|
||||
assert isinstance(host, str)
|
||||
daemons = item.get('services') # misnomer!
|
||||
assert isinstance(daemons, list)
|
||||
missing_names = []
|
||||
for s in daemons:
|
||||
name = '%s.%s' % (s.get('type'), s.get('id'))
|
||||
daemon_id = s.get('id')
|
||||
assert daemon_id
|
||||
name = '%s.%s' % (s.get('type'), daemon_id)
|
||||
if s.get('type') == 'rbd-mirror':
|
||||
metadata = self.mgr.get_metadata(
|
||||
"rbd-mirror", s.get('id'))
|
||||
"rbd-mirror", daemon_id)
|
||||
try:
|
||||
name = '%s.%s' % (s.get('type'), metadata['id'])
|
||||
except (KeyError, TypeError):
|
||||
|
Loading…
Reference in New Issue
Block a user