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')
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]