def _with_host(self, m, name): # type: (CephadmOrchestrator, str) -> None wait(m, m.add_host(HostSpec(hostname=name))) yield wait(m, m.remove_host(name))
def __init__(self, hosts, schedulable_hosts, unreachable_hosts): self.hosts = hosts self.unreachable_hosts = [HostSpec(h) for h in unreachable_hosts] self.schedulable_hosts = [HostSpec(h) for h in schedulable_hosts] self.last_tuned_profile_update = {}
def add(self, hostname: str, status: str): return self.api.add_host(HostSpec(hostname, status=status))
def _with_host(self, m, name): wait(m, m.add_host(HostSpec(hostname=name))) yield wait(m, m.remove_host(name))
def add_host(self, spec: HostSpec): self._inventory[spec.hostname] = spec.to_json() self.save()
def add(self, hostname: str): return self.api.add_host(HostSpec(hostname))