mirror of
https://github.com/ceph/ceph
synced 2025-02-23 02:57:21 +00:00
mgr/cephadm: simplify HostCache.get_daemon_types
Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
This commit is contained in:
parent
d770bb5c45
commit
32fdb84956
@ -671,7 +671,7 @@ class CephadmConfigChecks:
|
||||
self.log.warning(f"Host gather facts for {hostname} is missing kernel information")
|
||||
|
||||
# NOTE: if daemondescription had systemd enabled state, we could check for systemd 'tampering'
|
||||
self.host_to_role[hostname] = self.mgr.cache.get_daemon_types(hostname)
|
||||
self.host_to_role[hostname] = list(self.mgr.cache.get_daemon_types(hostname))
|
||||
|
||||
def run_checks(self) -> None:
|
||||
checks_enabled = self.mgr.get_module_option('config_checks_enabled')
|
||||
|
@ -870,13 +870,9 @@ class HostCache():
|
||||
|
||||
return [d for d in daemons if d.daemon_type in service_to_daemon_types(service_type)]
|
||||
|
||||
def get_daemon_types(self, hostname: str) -> List[str]:
|
||||
def get_daemon_types(self, hostname: str) -> Set[str]:
|
||||
"""Provide a list of the types of daemons on the host"""
|
||||
result = set()
|
||||
for _d, dm in self.daemons[hostname].items():
|
||||
assert dm.daemon_type is not None, f'no daemon type for {dm!r}'
|
||||
result.add(dm.daemon_type)
|
||||
return list(result)
|
||||
return cast(Set[str], {d.daemon_type for d in self.daemons[hostname].values()})
|
||||
|
||||
def get_daemon_names(self):
|
||||
# type: () -> List[str]
|
||||
|
Loading…
Reference in New Issue
Block a user