mirror of
https://github.com/ceph/ceph
synced 2025-02-20 17:37:29 +00:00
mgr/cephadm: use dict instead of defaultdict to silence mypy warning
otherwise we have: 1: cephadm/module.py:30: note: In module imported here: 1: cephadm/serve.py: note: In member "_check_for_strays" of class "CephadmServe": 1: cephadm/serve.py:395: error: Argument "default" to "get_metadata" of "MgrModule" has incompatible type "defaultdict[str, None]"; expected "Optional[Dict[str, str]]" Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
parent
5272748e17
commit
6c3d817435
@ -406,12 +406,11 @@ class CephadmServe:
|
||||
for s in daemons:
|
||||
name = '%s.%s' % (s.get('type'), s.get('id'))
|
||||
if s.get('type') == 'rbd-mirror':
|
||||
defaults = defaultdict(lambda: None, {'id': None})
|
||||
metadata = self.mgr.get_metadata(
|
||||
"rbd-mirror", s.get('id'), default=defaults)
|
||||
if metadata['id']:
|
||||
"rbd-mirror", s.get('id'))
|
||||
try:
|
||||
name = '%s.%s' % (s.get('type'), metadata['id'])
|
||||
else:
|
||||
except (KeyError, TypeError):
|
||||
self.log.debug(
|
||||
"Failed to find daemon id for rbd-mirror service %s" % (s.get('id')))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user