def assert_rm_daemon(cephadm: CephadmOrchestrator, prefix, host): dds: List[DaemonDescription] = wait(cephadm, cephadm.list_daemons(host=host)) d_names = [dd.name() for dd in dds if dd.name().startswith(prefix)] assert d_names c = cephadm.remove_daemons(d_names) [out] = wait(cephadm, c) match_glob(out, f"Removed {d_names}* from host '{host}'")
def assert_rm_daemon(cephadm: CephadmOrchestrator, prefix, host): dds: List[DaemonDescription] = wait(cephadm, cephadm.list_daemons(host=host)) d_names = [dd.name() for dd in dds if dd.name().startswith(prefix)] assert d_names # there should only be one daemon (if not match_glob will throw mismatch) assert len(d_names) == 1 c = cephadm.remove_daemons(d_names) [out] = wait(cephadm, c) # picking the 1st element is needed, rather than passing the list when the daemon # name contains '-' char. If not, the '-' is treated as a range i.e. cephadm-exporter # is treated like a m-e range which is invalid. rbd-mirror (d-m) and node-exporter (e-e) # are valid, so pass without incident! Also, match_gob acts on strings anyway! match_glob(out, f"Removed {d_names[0]}* from host '{host}'")