def METHOD_NAME(self):
    hosts = self.to_cluster_hosts(self.api_client.get_cluster_hosts(self.id))
    nodes = self.nodes.get_nodes(refresh=True)
    for host in hosts:
        name = self.find_matching_node_name(host, nodes)
        assert name is not None, (
            f"Failed to find matching node for host with mac address {host.macs()}"
            f" nodes: {[(n.name, n.ips, n.macs) for n in nodes]}"
        )
        role = consts.NodeRoles.MASTER if consts.NodeRoles.MASTER in name else consts.NodeRoles.WORKER
        self._infra_env.update_host(host_id=host.get_id(), host_role=role, host_name=name)