diff --git a/ccmlib/node.py b/ccmlib/node.py index cabec0e3..1ecd58af 100644 --- a/ccmlib/node.py +++ b/ccmlib/node.py @@ -522,7 +522,7 @@ def watch_log_for_death(self, nodes, from_mark=None, timeout=600, filename='syst the log is watched from the beginning. """ tofind = nodes if isinstance(nodes, list) else [nodes] - tofind = [f"{node.address()}.* now (dead|DOWN)" for node in tofind] + tofind = [f"({node.address()}|{node.hostid()}).* now (dead|DOWN)" for node in tofind] self.watch_log_for(tofind, from_mark=from_mark, timeout=timeout, filename=filename) def watch_log_for_alive(self, nodes, from_mark=None, timeout=120, filename='system.log'): @@ -531,7 +531,7 @@ def watch_log_for_alive(self, nodes, from_mark=None, timeout=120, filename='syst nodes are marked UP. This method works similarly to watch_log_for_death. """ tofind = nodes if isinstance(nodes, list) else [nodes] - tofind = [f"{node.address()}.* now UP" for node in tofind] + tofind = [f"({node.address()}|{node.hostid()}).* now UP" for node in tofind] self.watch_log_for(tofind, from_mark=from_mark, timeout=timeout, filename=filename) def wait_for_binary_interface(self, **kwargs): diff --git a/ccmlib/scylla_node.py b/ccmlib/scylla_node.py index 8d1cf3ca..fbaf679c 100644 --- a/ccmlib/scylla_node.py +++ b/ccmlib/scylla_node.py @@ -1449,6 +1449,10 @@ def rollback(self, upgrade_to_version): def hostid(self, timeout=60, force_refresh=False): if self.node_hostid and not force_refresh: return self.node_hostid + m = self.grep_log("init - Setting local host id to (.+?)$") + if m: + self.node_hostid = m[-1][1].group(1) + return self.node_hostid try: node_address = self.address() url = f"http://{node_address}:{self.api_port}/storage_service/hostid/local"